/* Sign-in page.
   Tokens, field well and focus ring are lifted verbatim from
   ask.css so the two pages read as one product. If you retune the palette there,
   retune it here — they are duplicated, not shared. */

:root{
  --ground:#17110f; --ground-2:#211813; --panel:#241a15; --panel-2:#2c211a;
  --line:#3a2c22; --line-soft:#31251d;
  --gold:#e4b24a; --gold-soft:#c9992f; --gold-ghost:rgba(228,178,74,.14);
  --text:#f3ece4; --muted:#b9a89c; --faint:#8c7c70;
  --rose:#d3633e;
  /* Status dot. Same values as ask.css so the login pill and the avatar's pill agree.
     These were used before they were defined — an undefined custom property makes the whole
     `background` declaration invalid, so the dot rendered with no colour at all. */
  --good:#4fb477; --bad:#d3633e;
  --r:14px; --ease:cubic-bezier(.4,.14,.2,1);
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,Georgia,serif;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
}

*{box-sizing:border-box}
html,body{margin:0}
body{
  background:radial-gradient(120% 90% at 78% -8%, #241812 0%, var(--ground) 46%, #100b0a 100%);
  color:var(--text); font-family:var(--sans); line-height:1.55; min-height:100vh;
  -webkit-font-smoothing:antialiased;
}

/* ── Sign-in page: design handoff "Login 1a - Incoming Call" ──
   One centred column (badge / lockup / form). Sizes scale with viewport height so the whole stack
   fits without scrolling down to ~540px tall — keep the vh clamps, not fixed pixels. */
html:has(.signin){background:#100b0a}
.signin{
  min-height:100vh; padding:clamp(16px,4vh,48px) 24px; overflow:hidden; line-height:normal;
  background:radial-gradient(120% 90% at 78% -8%, #241812 0%, var(--ground) 46%, #100b0a 100%);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:clamp(16px,4vh,40px);
}

.badge{position:relative; width:clamp(72px,16vh,160px); aspect-ratio:1}
.badge img{position:relative; width:100%; height:100%; border-radius:50%; display:block}
.ring{position:absolute; inset:0; border-radius:50%; border:2px solid var(--gold); animation:ring 3s var(--ease) infinite}
.ring:nth-child(2){animation-delay:1s}
.ring:nth-child(3){animation-delay:2s}
@keyframes ring{0%{transform:scale(1); opacity:.7} 100%{transform:scale(2.3); opacity:0}}

.lockup{display:flex; flex-direction:column; align-items:center; gap:clamp(6px,1.4vh,14px)}
.lockup img{height:clamp(30px,6vh,56px); width:auto; display:block}
/* padding-left matches the tracking so the line stays optically centred. */
.lockup span{font-size:clamp(12px,2vh,18px); font-weight:700; letter-spacing:.42em; padding-left:.42em; color:var(--gold)}

.signin form{width:100%; max-width:380px; display:flex; flex-direction:column; gap:clamp(10px,2vh,18px)}
.signin .field{display:block}
.signin .field > span:first-child{display:block; font-size:12.5px; font-weight:500; color:var(--muted); margin-bottom:7px}
.signin .field input{border-radius:14px; transition:border-color .16s var(--ease)}
.signin input:focus-visible{outline:none}

.signin button{
  margin-top:4px; width:100%; font:600 16.5px var(--sans); padding:.9em 1.8em; border-radius:999px;
  background:var(--gold); color:#231705; border:1px solid var(--gold); cursor:pointer; transition:.16s var(--ease);
}
.signin button:hover:not(:disabled){background:#f0c86e; border-color:#f0c86e}
.signin button:disabled{opacity:.42; cursor:not-allowed}

/* ── fields ── */
.field{margin:0 0 18px}
.field label{
  display:block; font-size:12.5px; color:var(--muted); margin:0 0 7px; font-weight:500;
}
/* The recessed "well" treatment from ask.css's .inputrow. */
.field input{
  width:100%; font-family:inherit; font-size:15px; color:var(--text);
  background:var(--ground); border:1.5px solid rgba(201,153,47,.4); border-radius:12px;
  padding:12px 13px; outline:none;
  box-shadow:inset 0 1px 4px rgba(0,0,0,.4);
  transition:border-color .16s var(--ease);
}
.field input::placeholder{color:var(--faint)}
.field input:focus{border-color:var(--gold)}
/* Chrome paints its own autofill background; force ours back. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:focus{
  -webkit-text-fill-color:var(--text);
  -webkit-box-shadow:0 0 0 1000px var(--ground) inset;
  caret-color:var(--text);
}
.field input[aria-invalid="true"],
.field input.input-validation-error{border-color:var(--rose)}

/* ── validation ── */
.err{display:block; color:var(--rose); font-size:12.5px; margin-top:6px; min-height:0}
.err:empty{display:none}
:focus-visible{outline:3px solid var(--gold); outline-offset:3px; border-radius:6px}

/* Visually hidden, still read aloud. Not display:none — that removes it from the a11y tree. */
.vh{position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; border:0}

/* ── brain status ──
   Same red/green semantics as the avatar's .statuspill on the Ask page: --bad offline,
   --good online. Quiet by design — it's information, not an alarm. */
.brainstatus{display:flex; align-items:center; justify-content:center; gap:8px;
  margin:22px 0 0; font-size:12px; letter-spacing:.03em; color:var(--faint)}
.brainstatus .d{width:7px; height:7px; border-radius:50%; flex:none; background:var(--bad)}
.brainstatus.online .d{background:var(--good)}
.brainstatus.offline{color:#c9a79a}
.brainstatus-note{margin:8px 0 0; text-align:center; font-size:11.5px; line-height:1.5; color:var(--faint)}

/* ── availability ──
   Three places, and this line is always present (unlike .brainstatus, which stays silent when
   healthy — see the note in Login.cshtml for why the two rules differ). ONE dot, graded through
   three states, because colour is carrying the state here rather than a second element:

     .free   green   there is room; the quietest treatment, --faint text like .brainstatus
     .last   gold    the last place — the only state where hesitating costs you the session,
                     so it borrows the brand gold rather than inventing an amber
     .busy   red     a stop, not a caution. Reuses --bad, the same red as the offline dot.

   The dot reuses the 7px/50% geometry of .brainstatus .d exactly, so the two lines sit on the
   same optical rhythm when both render. The colour is decoration: the sentence carries the
   state, and the dot is aria-hidden. */
.sitestatus{display:flex; align-items:center; justify-content:center; gap:8px;
  margin:14px 0 0; font-size:12px; letter-spacing:.03em; color:var(--faint)}
.sitestatus .d{width:7px; height:7px; border-radius:50%; flex:none; background:var(--good)}
.sitestatus.last{color:#d8ba7d}
.sitestatus.last .d{background:var(--gold)}
.sitestatus.busy{color:var(--bad)}
.sitestatus.busy .d{background:var(--bad)}
/* Only the full state carries a <b> ("Site busy"), so the rule is scoped to it rather than left
   open on .sitestatus where it would match nothing in the other two states. */
.sitestatus.busy b{font-weight:600; color:#e07a55}

@media (prefers-reduced-motion:reduce){
  *{transition:none !important; animation:none !important}
  .ring{opacity:0}
}

/* ── signed-out card (design C): outside the access hours, or no activity for 5 minutes ── */
.signin .card{
  width:100%; max-width:380px; background:var(--ground-2); border:1px solid var(--line); border-radius:18px;
  padding:26px 24px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:10px;
}
.card-icon{width:48px; height:48px; border-radius:50%; display:grid; place-items:center;
  background:var(--gold-ghost); color:var(--gold); border:1px solid var(--gold-soft)}
.signin .card h1{margin:4px 0 0; font:500 22px var(--serif)}
.signin .card p{margin:0 0 8px; font-size:14px; color:var(--muted); line-height:1.5}
.signin .go{
  display:block; width:100%; margin-top:4px; font:600 16.5px var(--sans); padding:.9em 1.8em; border-radius:999px;
  background:var(--gold); color:#231705; border:1px solid var(--gold); text-decoration:none; transition:.16s var(--ease);
}
.signin .go:hover{background:#f0c86e; border-color:#f0c86e}
