/* ==========================================================================
   Docent — Sign in
   Scope: .auth page only. Tokens are global and safe to lift into site.css.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --dc-navy: #002C5C;          /* ink, headings, brand panel */
  --dc-blue: #0168D8;          /* primary action, macron, focus */
  --dc-link: #1A73E8;          /* text links */
  --dc-ink-2: #3C4A60;         /* labels */
  --dc-ink-3: #5C6B82;         /* secondary copy */
  --dc-ink-4: #8A94A6;         /* placeholders, dividers text */
  --dc-line: #D9DCE3;          /* input borders */
  --dc-line-2: #E8E6E1;        /* card border, hairlines */
  --dc-paper: #F6F5F3;         /* page background */
  --dc-white: #FFFFFF;
  --dc-on-navy-2: #B8C7DB;     /* secondary text on navy */
  --dc-on-navy-3: #7F93AE;     /* tertiary text on navy */

  --dc-font-display: 'Plus Jakarta Sans', 'Segoe UI', Arial, sans-serif;
  --dc-font-body: 'Inter', 'Segoe UI', Arial, sans-serif;

  --dc-radius-sm: 10px;        /* inputs, buttons */
  --dc-radius-lg: 20px;        /* card */
  --dc-control-h: 48px;
  --dc-focus: 0 0 0 3px rgba(1, 104, 216, .18);
  --dc-shadow-card: 0 12px 40px rgba(0, 44, 92, .06);
  --opacity-50: .5;            /* login.js dims the card with this while it waits */
}

/* --- Page --------------------------------------------------------------- */
.auth { margin: 0; background: var(--dc-paper); color: var(--dc-navy); font: 400 15px/1.5 var(--dc-font-body); -webkit-font-smoothing: antialiased; }
.auth a { color: var(--dc-link); text-decoration: none; }
.auth a:hover { color: var(--dc-blue); text-decoration: underline; }

.auth__layout { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

/* --- Brand panel -------------------------------------------------------- */
.auth__brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: 56px 72px; box-sizing: border-box; background: var(--dc-navy); color: var(--dc-white); }
.auth__brand-ring { position: absolute; right: -180px; bottom: -220px; width: 620px; height: 620px; border-radius: 50%; border: 96px solid rgba(255,255,255,.05); pointer-events: none; }
.auth__brand-bar  { position: absolute; right: 160px; bottom: 290px; width: 290px; height: 46px; border-radius: 999px; background: rgba(1,104,216,.55); pointer-events: none; }
.auth__brand-copy { position: relative; max-width: 520px; }
.auth__headline { margin: 0 0 22px; font: 800 clamp(36px, 3.6vw, 52px)/1.08 var(--dc-font-display); letter-spacing: -.03em; }
.auth__subhead { margin: 0 0 36px; font-size: 18px; line-height: 1.55; color: var(--dc-on-navy-2); }
.auth__brand-footer { position: relative; display: flex; gap: 22px; font-size: 13px; color: var(--dc-on-navy-3); }
.auth__brand-footer a { color: inherit; }

/* --- Lockup ------------------------------------------------------------- */
/* The macron is drawn as a bar so it stays brand blue. Metrics are tuned
   for Plus Jakarta Sans 800; if you change the face, re-tune .lockup__o::after. */
.lockup { display: inline-flex; align-items: center; gap: .45em; font: 800 30px/1 var(--dc-font-display); letter-spacing: -.035em; color: var(--dc-navy); text-decoration: none !important; }
.lockup--sm { font-size: 24px; }
.lockup__icon { width: 1.33em; height: 1.33em; flex: none; }
.lockup__icon-bar { fill: var(--dc-blue); }
.lockup__icon-ring { fill: none; stroke: currentColor; stroke-width: 8; }
.lockup__word { position: relative; }
.lockup__o { position: relative; display: inline-block; }
.lockup__o::after { content: ""; position: absolute; left: 13%; right: 13%; top: .08em; height: .105em; border-radius: 999px; background: var(--dc-blue); }
.lockup--reversed { color: var(--dc-white); }

/* --- Typing indicator --------------------------------------------------- */
.typing { display: inline-flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px 16px 16px 4px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.10); }
.typing__dots { display: inline-flex; gap: 6px; }
.typing__dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--dc-blue); animation: dc-bounce 1.2s infinite ease-in-out; }
.typing__dots i:nth-child(2) { animation-delay: .15s; }
.typing__dots i:nth-child(3) { animation-delay: .3s; }
.typing__label { font-size: 14px; color: var(--dc-on-navy-2); }
@keyframes dc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing__dots i { animation: none; opacity: 1; } }

/* --- Form panel --------------------------------------------------------- */
.auth__form-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; box-sizing: border-box; }
.auth__mobile-header { display: none; }

.card { width: 100%; max-width: 440px; background: var(--dc-white); border: 1px solid var(--dc-line-2); border-radius: var(--dc-radius-lg); padding: 40px; box-sizing: border-box; box-shadow: var(--dc-shadow-card); }
.card__title { margin: 0 0 8px; font: 800 30px/1.1 var(--dc-font-display); letter-spacing: -.03em; }
.card__sub { margin: 0 0 28px; color: var(--dc-ink-3); }
.card__footer { margin: 24px 0 0; text-align: center; font-size: 14px; color: var(--dc-ink-3); }
.card__footer a { font-weight: 600; }

/* --- Buttons ------------------------------------------------------------ */
.btn { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: var(--dc-control-h); padding: 0 18px; border-radius: var(--dc-radius-sm); font: 600 15px/1 var(--dc-font-body); cursor: pointer; text-decoration: none !important; transition: background-color .15s, border-color .15s, box-shadow .15s; }
.btn--block { width: 100%; }
.btn--primary { background: var(--dc-blue); color: var(--dc-white); border: 0; }
.btn--primary:hover { background: #0158B8; color: var(--dc-white); }
.auth a.btn--primary, .auth a.btn--primary:hover { color: var(--dc-white); } /* a link styled as the primary button ("Back to sign in") */
/* "a.": the Google button is a link, and .auth a would otherwise make its text link-blue */
.auth a.btn--secondary { background: var(--dc-white); color: var(--dc-navy); border: 1px solid var(--dc-line); }
.auth a.btn--secondary:hover { border-color: var(--dc-navy); color: var(--dc-navy); }
.btn:focus-visible { outline: none; box-shadow: var(--dc-focus); }

/* --- Divider ------------------------------------------------------------ */
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--dc-ink-4); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--dc-line-2); }

/* --- Fields ------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; color: var(--dc-ink-2); }
.field__link { font-size: 13px; }
.field__control { position: relative; }
.field__input { box-sizing: border-box; width: 100%; height: var(--dc-control-h); padding: 0 14px; border: 1px solid var(--dc-line); border-radius: var(--dc-radius-sm); background: var(--dc-white); font: 400 15px/1 var(--dc-font-body); color: var(--dc-navy); }
.field__control .field__input { padding-right: 44px; }
.field__input::placeholder { color: var(--dc-ink-4); }
.field__input:focus { outline: none; border-color: var(--dc-blue); box-shadow: var(--dc-focus); }
.field__input[aria-invalid="true"] { border-color: #C8352D; }
.field__toggle { position: absolute; right: 8px; top: calc(var(--dc-control-h) / 2); transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; color: var(--dc-ink-4); cursor: pointer; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.field__toggle svg { width: 18px; height: 18px; }
.field__toggle:hover { color: var(--dc-navy); }
.field__toggle:focus-visible { outline: none; box-shadow: var(--dc-focus); }

/* Rebar's Validation (rebar.min.js) marks a missing field with .field-error and adds an .inline-error-msg after it */
.field__input.field-error { border-color: #C8352D; }
.inline-error-msg { margin-top: 6px; font-size: 13px; color: #8E1F19; }

/* Clicks on a button's icon count as clicks on the button (login.js checks e.target.id for #signup-google) */
.btn svg { pointer-events: none; }
.auth .d-none { display: none; }

/* --- Terms checkbox (sign-up) ------------------------------------------- */
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 4px; font-size: 14px; color: var(--dc-ink-2); }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--dc-blue); flex: none; }
.check input.field-error { outline: 2px solid #C8352D; outline-offset: 1px; }
#chkvalidation { margin-bottom: 16px; }

/* --- Password rules (reset) --------------------------------------------- */
/* checkPassword() in login.js swaps each icon between fa-circle-xmark and fa-circle-check and adds .completed */
.passwordCheck { list-style: none; margin: -4px 0 18px; padding: 0; display: grid; gap: 6px; font-size: 13px; color: var(--dc-ink-3); }
.passwordCheck li { display: flex; align-items: center; gap: 8px; }
.passwordCheck i { width: 16px; height: 16px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 700 10px/1 var(--dc-font-body); font-style: normal; background: #F3C9C6; color: #8E1F19; }
.passwordCheck i::before { content: "✕"; }
.passwordCheck .completed { color: #1E7B45; }
.passwordCheck .completed i { background: #CDEBD8; color: #1E7B45; }
.passwordCheck .completed i::before { content: "✓"; }

/* --- Alerts & notices --------------------------------------------------- */
.alert { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--dc-radius-sm); font-size: 14px; }
.alert--error { background: #FBEAE9; color: #8E1F19; border: 1px solid #F3C9C6; }
.invalid-error { display: none; } /* login.js shows it with the failure message */
.recaptcha-notice { margin: 20px 0 0; text-align: center; font-size: 11px; color: var(--dc-ink-4); }
.recaptcha-notice a { color: inherit; }
.grecaptcha-badge { visibility: hidden; } /* allowed by Google when the notice above is shown */

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
  .auth__layout { grid-template-columns: 1fr; }
  .auth__brand { display: none; }
  .auth__form-panel { justify-content: flex-start; padding: 0 0 32px; }
  .auth__mobile-header { display: block; width: 100%; padding: 56px 24px 28px; box-sizing: border-box; background: var(--dc-navy); border-radius: 0 0 28px 28px; margin-bottom: 24px; }
  .card { max-width: none; margin: 0 16px; padding: 28px 20px; border-radius: 16px; }
}
