:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f6f7f9;
  font-synthesis: none;
  --ink: #172033;
  --muted: #596478;
  --line: #d6dce5;
  --orange: #b84608;
  --orange-hover: #933706;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a, input { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #1260aa; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.skip-link { position: fixed; z-index: 5; top: -80px; left: 16px; padding: 12px 18px; border-radius: 8px; color: #fff; background: var(--ink); }
.skip-link:focus { top: 16px; }
.auth-layout { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(330px, 1fr) minmax(420px, 1fr); }
.brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: clamp(32px, 6vw, 88px); color: #fff; background: linear-gradient(145deg, #963a0a 0%, #bc4b0e 64%, #c25718 100%); }
.brand-panel::before, .brand-panel::after { position: absolute; border: 1px solid #ffffff26; border-radius: 50%; pointer-events: none; content: ""; }
.brand-panel::before { width: 500px; height: 500px; right: -290px; top: -150px; }
.brand-panel::after { width: 360px; height: 360px; left: -190px; bottom: -190px; }
.brand, .brand-message, .brand-footer { position: relative; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 23px; font-weight: 750; letter-spacing: -.04em; }
.brand small { display: block; margin-top: 2px; font-size: 11px; font-weight: 650; letter-spacing: .2em; }
.brand-mark { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; border: 1px solid #ffffff57; border-radius: 14px; color: #9a3a08; background: #fff; font-size: 19px; font-weight: 850; letter-spacing: -.08em; }
.brand-message { padding: 12px 0 30px; max-width: 450px; }
.eyebrow { margin: 0 0 11px; color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: .12em; line-height: 1.6; }
.brand-message .eyebrow { color: #ffeadf; }
.brand-heading { margin: 0 0 23px; font-size: clamp(34px, 3.7vw, 54px); font-weight: 720; line-height: 1.13; letter-spacing: -.045em; }
.brand-message > p:last-child { max-width: 365px; margin: 0; color: #ffede3; font-size: 16px; line-height: 1.7; }
.brand-footer { margin: 0; color: #ffe9dd; font-size: 12px; }
.access-panel { display: grid; place-items: center; padding: 48px 36px; background: #fbfcfd; }
.auth-card { width: min(100%, 440px); min-width: 0; }
.access-tag { display: flex; align-items: center; gap: 8px; margin: 0 0 31px; color: #466452; font-size: 12px; font-weight: 650; }
.access-tag span { color: #237344; font-size: 9px; }
#auth-content h1 { margin: 0 0 12px; color: var(--ink); font-size: 29px; line-height: 1.2; letter-spacing: -.035em; }
.intro { margin: 0 0 25px; color: var(--muted); font-size: 14px; line-height: 1.65; }
form { display: grid; gap: 19px; margin: 24px 0 0; }
.field { display: grid; gap: 8px; min-width: 0; }
.field label { color: #344155; font-size: 13px; font-weight: 700; }
.field input { width: 100%; min-height: 48px; min-width: 0; border: 1px solid #abb6c6; border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fff; font-size: 16px; }
.field input:focus { border-color: var(--orange); }
.field input:disabled { background: #f2f4f7; }
.hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; border: 1px solid transparent; border-radius: 10px; padding: 12px 16px; font-size: 14px; font-weight: 750; line-height: 1.5; text-align: center; }
.primary { color: #fff; background: var(--orange); }
.primary:hover:not(:disabled) { background: var(--orange-hover); }
.primary:disabled { color: #fff; background: #697382; }
.secondary { color: #344155; background: #fff; border-color: #aab5c4; }
.secondary:hover:not(:disabled) { background: #f2f5f8; }
.secondary:disabled { color: #697382; }
.text-button { display: block; min-height: 44px; margin: 12px auto 0; border: 0; padding: 10px 8px; color: var(--orange); background: transparent; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.text-button:disabled { color: var(--muted); }
.notice { margin: 0 0 24px; border: 1px solid #bdcedc; border-radius: 10px; padding: 13px 15px; color: #244a66; background: #eef5fb; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.notice.error { color: #8c271e; background: #fff1ef; border-color: #e7bbb6; }
.notice.success { color: #22583a; background: #eef8f1; border-color: #b9d7c5; }
.enroll-steps { margin: 0 0 22px; padding-left: 21px; color: #435065; font-size: 14px; line-height: 1.6; }
.enroll-steps li { padding-left: 3px; margin-top: 8px; }
.qr-frame { display: grid; place-items: center; width: min(280px, 100%); margin: 22px auto 17px; border: 1px solid #dce1e7; border-radius: 14px; padding: 12px; background: #fff; }
.qr-frame svg { display: block; width: 100%; height: auto; max-width: 256px; }
.manual-key { border: 1px solid #dce1e7; border-radius: 10px; padding: 12px 14px; background: #f4f6f9; }
.manual-key summary { color: #344155; font-size: 13px; font-weight: 650; cursor: pointer; line-height: 1.6; }
.manual-key code { display: block; margin-top: 10px; padding: 10px 0 2px; color: var(--ink); font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.code-input { font-variant-numeric: tabular-nums; letter-spacing: .2em; }
.recovery-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 23px 0; padding: 0; list-style: none; }
.recovery-list li { border: 1px solid #d6dce5; border-radius: 8px; padding: 11px 6px; background: #f2f5f8; text-align: center; }
.recovery-list code { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: #25344a; overflow-wrap: anywhere; }
.acknowledge { display: flex; align-items: flex-start; gap: 10px; margin: 22px 0; color: #435065; font-size: 13px; line-height: 1.6; cursor: pointer; }
.acknowledge input { flex-shrink: 0; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--orange); }
.action-stack { display: grid; gap: 12px; }
@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; }
  .brand-panel { padding: 23px 26px; gap: 0; }
  .brand { font-size: 20px; }
  .brand-mark { width: 42px; height: 42px; border-radius: 12px; }
  .brand-message, .brand-footer { display: none; }
  .access-panel { align-items: start; padding: 35px 24px 48px; }
  .access-tag { margin-bottom: 27px; }
}
@media (max-width: 360px) {
  .access-panel { padding-left: 18px; padding-right: 18px; }
  #auth-content h1 { font-size: 26px; }
  .recovery-list { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }

/* Same warm brand as the CRM, with texture outside the working form. */
.brand-panel { background-color:#813709; background-image:repeating-linear-gradient(135deg,transparent 0,transparent 8px,#ffffff07 8px,#ffffff07 9px),linear-gradient(145deg,#542a18,#873c16 68%,#a44d20); }
.brand-mark { background:#fffaf5; border-color:#ffffff80; }
.brand-mark img { display:block; width:38px; height:38px; object-fit:contain; }
.access-panel { background-color:#faf7f2; background-image:radial-gradient(#c9b79d30 .7px,transparent .7px); background-size:7px 7px; }
.auth-card { width:min(100%,500px); padding:34px; border:1px solid #e7ddd2; border-radius:20px; background:#fffefd; box-shadow:0 18px 58px #5637200d; }
.auth-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin-bottom:15px; }
.auth-meta .environment-tag, .auth-meta .access-tag { margin:0; }
.environment-tag { display:inline-flex; margin:0 0 14px; padding:6px 10px; border:1px solid #e6ded4; border-radius:7px; background:#f7f3ed; color:#584431; font-size:12px; font-weight:750; }
.environment-tag.test-environment { color:#6e4609; background:#fff4d9; border-color:#e8cd91; }
.environment-hint { margin:0 0 20px; color:#665747; font-size:12px; line-height:1.6; }
.access-tag { margin-bottom:24px; }
.first-access-hint { max-width:40ch; margin:0 auto 6px; text-align:center; }
#auth-content h1:focus { outline:none; }
@media (max-width:820px) { .access-panel { padding:24px 16px 38px; } .auth-card { padding:26px 24px; } }
@media (max-width:360px) { .auth-card { padding:23px 18px; border-radius:16px; } }
