/* Control Room — sign-in, sign-up and the account screen. Uses the tokens from app.css. */

body.auth-mode .shell, body.auth-mode .tabbar, body.auth-mode .offline, body.auth-mode .guestbar { display: none !important; }
.auth { display: none; min-height: calc(100dvh / var(--z, 1)); }
body.auth-mode .auth { display: block; }

.auth-wrap {
  width: 100%; max-width: 440px; margin: 0 auto; min-height: calc(100dvh / var(--z, 1)); display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px);
}
.auth-top { min-height: 44px; display: flex; align-items: center; }
.auth-back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin-left: -10px; padding: 0 10px; border-radius: 12px; color: var(--cobalt-ink); font-weight: 600; font-size: 16px; }
.auth-brand { margin: 5vh 0 26px; text-align: left; }
.auth-brand img { width: 60px; height: 60px; border-radius: 16px; box-shadow: var(--shadow-card); }
.auth-brand h1 { margin: 18px 0 6px; font: 700 34px/1.1 var(--display); letter-spacing: -.025em; }
.auth-brand p { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 30ch; }
.auth-title { margin: 6px 0 4px; font: 700 28px/1.15 var(--display); letter-spacing: -.02em; }
.auth-sub { margin: 0 0 18px; color: var(--ink-2); font-size: 15.5px; }
.auth-sub b { color: var(--ink); word-break: break-all; }

.provider-stack { display: grid; gap: 12px; }
.pbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 20px;
  border-radius: 999px; font-size: 17px; font-weight: 600; letter-spacing: -.005em; text-align: center;
  transition: transform .12s ease, opacity .15s ease;
}
.pbtn:active { transform: scale(.98); }
.pbtn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.pbtn[disabled], .pbtn[aria-disabled="true"] { opacity: .5; cursor: default; transform: none; }
/* Sign in with Apple: black button with a white logo; white button with a black logo in dark mode (Apple HIG) */
.pbtn.apple { background: #000; color: #fff; }
:root[data-theme="dark"] .pbtn.apple { background: #fff; color: #000; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pbtn.apple { background: #fff; color: #000; } }
.pbtn.github { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.pbtn.email { background: var(--cobalt); color: var(--on-accent); }
.pbtn.email:hover { background: var(--cobalt-ink); }
.auth-hint { margin: -4px 4px 0; font-size: 13.5px; color: var(--ink-3); line-height: 1.35; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--ink-3); font-size: 13.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

.auth-form { display: grid; gap: 14px; }
.auth-form .seg { width: 100%; margin-bottom: 4px; }
.auth-form .seg button { flex: 1; min-height: 40px; }
.fld { display: grid; gap: 6px; }
.fld > label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.fld .inp { width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px; background: var(--surface); font-size: 17px; }
.fld .pw { position: relative; }
.fld .pw .inp { padding-right: 56px; }
.fld .pw button { position: absolute; top: 0; right: 0; width: 52px; height: 52px; display: grid; place-items: center; color: var(--ink-3); border-radius: 14px; }
.fld small { color: var(--ink-3); font-size: 13.5px; line-height: 1.35; }
.fld.code .inp { text-align: center; font: 700 30px/1 var(--display); letter-spacing: .38em; padding-left: .38em; min-height: 62px; font-variant-numeric: tabular-nums; }
.auth-msg { padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.35; background: var(--brick-soft); color: var(--brick); font-weight: 500; }
.auth-msg.info { background: var(--cobalt-soft); color: var(--cobalt-ink); }
.auth-msg.good { background: var(--moss-soft); color: var(--moss); }
.auth-form .btn.primary { min-height: 54px; font-size: 17px; width: 100%; }
.auth-links { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; margin-top: 4px; }
.auth-links .btn.plain { min-height: 44px; font-size: 15px; }
.auth-card { flex: 1; display: flex; flex-direction: column; }
.auth-legal { margin-top: auto; padding-top: 28px; text-align: center; color: var(--ink-3); font-size: 13px; line-height: 1.5; }
.auth-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; padding: 8px 4px; }
.demo-note { display: flex; gap: 10px; align-items: flex-start; margin: 22px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14px; line-height: 1.4; }
.demo-note b { display: block; font-size: 14.5px; }
.auth-busy { cursor: progress; }

@media (min-width: 900px) {
  .auth-wrap { justify-content: center; min-height: calc(100dvh / var(--z, 1)); padding-top: 40px; padding-bottom: 40px; }
  .auth-card { flex: none; background: var(--surface-2); border-radius: 28px; padding: 36px 36px 28px; box-shadow: var(--shadow-card); }
  .auth-wrap .auth-brand { margin-top: 0; }
  .auth-legal { margin-top: 18px; padding-top: 0; }
  .fld .inp { background: var(--surface); }
}

/* the account screen */
.acct-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 18px; }
.acct-av { width: 64px; height: 64px; border-radius: 50%; background: var(--cobalt-soft); color: var(--cobalt-ink); display: grid; place-items: center; font: 700 24px var(--display); overflow: hidden; flex: none; }
.acct-av img { width: 100%; height: 100%; object-fit: cover; }
.acct-head b { display: block; font: 650 22px/1.2 var(--display); }
.acct-head span { color: var(--ink-2); font-size: 15px; word-break: break-all; }
.av.brand { background: var(--sunk); color: var(--ink); display: grid; place-items: center; flex: none; }
.av.brand svg { width: 20px; height: 20px; fill: currentColor; }
.danger-zone .btn { color: var(--brick); }
.dlg-warn { margin: 6px 0 14px; color: var(--ink-2); font-size: 15px; line-height: 1.4; }
.btn.bad { background: var(--brick); color: #fff; box-shadow: none; }

.fld.code .inp::placeholder { color: var(--ink-3); opacity: .45; }

/* guests: a soft banner that keeps its place, and the page leaves room for it */
.guestbar { position: fixed; top: 0; left: 0; right: 0; z-index: 25; display: flex; align-items: center; gap: 12px; min-height: calc(var(--safe-t) + 52px); padding: var(--safe-t) 12px 0 16px;
  background: var(--amber-soft); color: var(--amber-ink); border-bottom: 1px solid var(--amber-edge); font-size: 13.5px; line-height: 1.3; font-weight: 500; }
.guestbar[hidden] { display: none; }
.guestbar span { flex: 1 1 150px; min-width: 0; }
.guestbar .btn { flex: none; }
/* a longer language (French, Russian) may need two lines: the bar grows and the page below follows its measured height (--gb-h, set in core.js) */
.guestbar { flex-wrap: wrap; row-gap: 6px; padding-top: calc(var(--safe-t) + 6px); padding-bottom: 6px; }
body.has-guestbar .view { padding-top: calc(var(--gb-h, calc(var(--safe-t) + 52px)) + 8px); }
@media (min-width: 900px) {
  .guestbar { left: 256px; min-height: 48px; padding-top: 0; font-size: 14.5px; justify-content: center; }
  .guestbar span { flex: none; }
  body.has-guestbar .view { padding-top: 76px; }
  body.has-guestbar .sidebar { height: calc(100dvh / var(--z, 1)); }
  body.has-guestbar .today .col-b, body.has-guestbar .agent-grid .side, body.has-guestbar .brief-grid .side { top: 72px; }
}
body.has-guestbar .toasts { top: calc(var(--gb-h, calc(var(--safe-t) + 52px)) + 10px); }
@media (min-width: 900px) { body.has-guestbar .toasts { top: 58px; } }
/* the page scrolls when the keyboard opens: keep it from sliding under the status bar clock */
body.auth-mode::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--safe-t); background: var(--bg); z-index: 50; }

/* links to the legal pages inside the app (sign-in screens, Settings footers, the portal) */
.sb-foot .hint a, .foot a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.lg-card .lg-f + .lg-f { margin-top: 4px; }
