/* Davidson CRM · sign-in, set-password and lockout pages (templates/auth_base.html). Standalone: crm.css is not loaded here.
   Brand (davidson-brand skill): Lato; black, white and dark grey with bright teal #00C7C4 as the one accent, carried by the
   button (black text on teal) and the logo. Teal is never a text colour on white (2.1:1). One logo: primary on white,
   reversed lockup on black (the desktop panel, and the phone in dark mode). Same tokens as the chat (chat.css) so it reads
   as one product. iPhone first: 390 pt, safe areas, 44 pt targets, 17 px fields so iOS never zooms. */

.authpage {
  --teal: #00C7C4; --deep: #06ABB7;
  --bg: #FFFFFF; --side: #000000; --ink: #000000; --ink2: #4D4D4D; --ink3: #6B6B6B;
  --field: #F4F5F5; --line: #D1D3D4; --line-hover: #B9BBBC; --hair: #E3E5E6;
  --note: #F4F5F5; --err-bg: #FFF3E8; --err-bar: #B4541A; --ok-bg: #E6F8F8; --ok-bar: #06ABB7;
  --quiet-bg: #FFFFFF; --quiet-hover: #F4F5F5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  .authpage {
    --bg: #000000; --ink: #FFFFFF; --ink2: #B4B6B7; --ink3: #98989D;
    --field: #1C1C1E; --line: #38383A; --line-hover: #4D4D4D; --hair: #2C2C2E;
    --note: #1C1C1E; --err-bg: #2A1C12; --err-bar: #E08A4F; --ok-bg: #0C2526; --ok-bar: #00C7C4;
    --quiet-bg: #000000; --quiet-hover: #1C1C1E;
  }
}

@media (prefers-color-scheme: dark) { html:has(.authpage) { background: #000; } }
.authpage, .authpage *, .authpage *::before, .authpage *::after { box-sizing: border-box; }
html:has(.authpage) { background: #fff; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.authpage {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 Lato, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}

/* ---------- the page: one column on a phone ---------- */
.auth {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: max(28px, calc(env(safe-area-inset-top) + 16px)) max(24px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
.auth-brand { padding: 12px 0 0; }
.auth-brand picture { display: block; }
.auth-logo { display: block; width: 216px; height: auto; }       /* 180 px is the brand minimum on screen */
.auth-tagline { display: none; }
.auth-main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 400px; }
.auth-panel { padding: 44px 0 32px; }

/* ---------- type ---------- */
.auth h1 { margin: 0; font-weight: 700; font-size: 2rem; line-height: 1.2; letter-spacing: -.01em; color: var(--ink); }
.auth-sub { margin: 8px 0 28px; font-size: 1rem; color: var(--ink2); }
.auth-help { margin: 24px 0 0; font-size: .9375rem; line-height: 1.5; color: var(--ink2); }
.auth-help + .auth-help { margin-top: 12px; }
.auth-help a { color: var(--ink); font-weight: 700; text-underline-offset: 2px; }
.auth-hint { margin: 8px 0 0; font-size: .875rem; color: var(--ink3); }
.auth-foot { margin-top: auto; padding-top: 16px; font-size: .8125rem; line-height: 1.4; color: var(--ink3); }

/* ---------- form ---------- */
.auth-form { display: grid; gap: 20px; margin: 0; }
.auth-field label { display: block; margin: 0 0 8px; font-weight: 700; font-size: .9375rem; color: var(--ink); }
.auth-field input {
  display: block; width: 100%; height: 52px; margin: 0; padding: 0 14px; font: 400 17px/1.2 Lato, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  -webkit-appearance: none; appearance: none; transition: border-color .12s, background-color .12s;
}
.auth-field input:hover { border-color: var(--line-hover); }
.auth-field input:focus { outline: 2px solid var(--deep); outline-offset: 0; border-color: var(--deep); background: var(--bg); }
.auth-field input.auth-readonly { background: transparent; border-style: dashed; color: var(--ink2); }
.auth-field input.auth-readonly:focus { outline: none; border-color: var(--line); }
.auth-pw { position: relative; }
.auth-pw input { padding-right: 76px; }
.auth-reveal {
  position: absolute; top: 4px; right: 4px; min-width: 64px; height: 44px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--ink2); font: 700 .875rem/1 Lato, "Helvetica Neue", Arial, sans-serif; cursor: pointer;
}
.auth-reveal:hover { color: var(--ink); background: var(--hair); }
.auth-reveal:focus-visible { outline: 2px solid var(--deep); outline-offset: -2px; }

/* the one teal thing on the page: black Lato Bold on bright teal */
.auth-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px; margin: 8px 0 0; padding: 0 20px;
  border: 0; border-radius: 12px; background: var(--teal); color: #000; font: 700 1.0625rem/1.2 Lato, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none; cursor: pointer; transition: background-color .12s;
}
.auth-btn:hover { background: var(--deep); color: #000; }
.auth-btn:active { background: var(--deep); }
.auth-btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.auth-btn[aria-busy="true"], .auth-btn:disabled { opacity: .7; cursor: progress; }
.auth-btn-quiet { margin-top: 24px; background: var(--quiet-bg); color: var(--ink); border: 1px solid var(--line); }
.auth-btn-quiet:hover, .auth-btn-quiet:active { background: var(--quiet-hover); color: var(--ink); }

/* ---------- messages ---------- */
.auth-flash { margin: 0 0 20px; padding: 12px 14px; border-radius: 10px; border-left: 3px solid var(--ok-bar); background: var(--ok-bg); color: var(--ink); font-size: .9375rem; }
.auth-flash.error { border-left-color: var(--err-bar); background: var(--err-bg); }
.auth-note { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--note); color: var(--ink); }
.auth-note svg { flex: none; margin-top: 1px; color: var(--ink2); }
.auth-note p { margin: 0; font-size: 1rem; }
.auth-note strong { font-weight: 700; }

/* ---------- desktop and iPad landscape: a black brand panel beside the form ---------- */
@media (min-width: 960px) {
  .auth { display: grid; grid-template-columns: minmax(400px, 40%) 1fr; padding: 0; }
  .auth-brand {
    display: flex; flex-direction: column; justify-content: space-between; padding: 64px 56px 56px;
    background: var(--side); color: #fff; min-height: 100vh; min-height: 100dvh;
  }
  .auth-logo { width: 280px; }
  .auth-tagline { display: block; margin: 0; max-width: 12em; font-weight: 300; font-size: 2.5rem; line-height: 1.25; color: #fff; }
  .auth-main { max-width: none; align-items: center; justify-content: center; padding: 48px 56px 32px; }
  .auth-panel { width: 100%; max-width: 400px; margin: auto 0; padding: 0; }
  .auth-foot { margin-top: 0; padding-top: 32px; text-align: center; }
}
@media (min-width: 960px) and (prefers-color-scheme: dark) {
  .authpage { --bg: #0E0E0F; }
  .auth-brand { border-right: 1px solid #2C2C2E; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-field input, .auth-btn { transition: none; }
}

/* Sign in with Google (08/10/2026): white with Google's G, as Google's own button guidance asks */
.auth-btn-google { gap: 12px; background: #fff; color: #1f1f1f; border: 1px solid #747775; }
.auth-btn-google:hover, .auth-btn-google:active { background: #f2f2f2; color: #1f1f1f; }
.auth-or { margin: 28px 0 4px; color: var(--ink2); font-size: .875rem; text-align: center; }
@media (prefers-color-scheme: dark) { .auth-btn-google { background: #131314; color: #e3e3e3; border-color: #8e918f; }
  .auth-btn-google:hover, .auth-btn-google:active { background: #1f1f20; color: #e3e3e3; } }
