/* Light redesign for the auth screens (login / register / verify / password),
 * extending the design language ADR-181 introduced for the manage area.
 *
 * Loaded ONLY by auth/_shell.html (not by base.html), so landing.html and
 * anything else on style.css's dark theme is untouched. Everything here is
 * scoped under `body.auth-body` / `.auth-shell` for the same reason: the
 * generic class names the auth templates reuse from style.css (.btn,
 * .form-grid, .alert, .muted) must keep their dark look everywhere else.
 *
 * Tokens are the ADR-181 ones (manage-light.css): #4f63e9 blue, #ff5147
 * coral, #202746 navy, #898fa2 muted, #e9eefb line, #f3f7ff tint.
 * The @font-face blocks are repeated here rather than shared, because
 * manage-light.css is a manage-only sheet that auth pages never load.
 */

@font-face {
  font-family: "Discovery Fs";
  src: url("/static/fonts/Discovery_Fs-Light.woff2") format("woff2"),
       url("/static/fonts/Discovery_Fs-Light.ttf") format("truetype");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Discovery Fs";
  src: url("/static/fonts/Discovery_Fs-Bold.woff2") format("woff2"),
       url("/static/fonts/Discovery_Fs-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pil Kahol";
  src: url("/static/fonts/FtPilKahol2.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

.auth-body {
  --al-blue: #4f63e9;
  --al-blue-dark: #3b4bd0;
  --al-navy: #202746;
  --al-muted: #898fa2;
  --al-line: #e9eefb;
  --al-tint: #f3f7ff;
  --al-coral: #ff5147;
  --al-font: "Discovery Fs", "Segoe UI", "Arial Hebrew", Arial, sans-serif;

  /* style.css paints <body> with the dark radial gradient and declares
     `color-scheme: dark` unconditionally — the latter is what makes native
     controls (select popups, autofill, scrollbars) render in dark chrome no
     matter what colors the elements around them get (same trap as ADR-183). */
  background: #ffffff;
  color-scheme: light;
  color: var(--al-navy);
  font-family: var(--al-font);
  font-weight: 300;
}

/* ══════════════════════════ Split shell ══════════════════════════ */
/* Two explicit grid columns instead of DOM order: the aside comes FIRST in
   the markup (it is the page's brand header on narrow screens, where the
   grid collapses to one column), but on desktop RTL column 1 is the right
   edge, and the form belongs there — where the reader's eye starts. */
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 42vw, 620px);
  min-height: 100vh;
}
/* grid-row is as load-bearing as grid-column here: with only the column
   pinned, auto-placement puts the aside in row 1 / column 2 and then finds
   its cursor already past column 1, so the form drops to a second row and
   the two halves stack diagonally instead of sitting side by side. */
.auth-main { grid-column: 1; grid-row: 1; }
.auth-aside { grid-column: 2; grid-row: 1; }

/* ── form side ── */
.auth-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  background: #ffffff;
}
.auth-panel { width: 100%; max-width: 400px; }
.auth-panel-wide { max-width: 620px; }

.auth-logo { display: block; margin-bottom: 2.2rem; }
.auth-logo img { width: 176px; height: auto; display: block; }

.auth-head { margin-bottom: 1.6rem; }
.auth-head h1 {
  font-size: 30px; font-weight: 700; line-height: 1.2;
  letter-spacing: -.01em; color: var(--al-navy); margin: 0 0 .4rem;
}
.auth-head p, .auth-shell .muted {
  color: var(--al-muted); font-size: 14px; font-weight: 300; line-height: 1.6;
}
/* :not(.btn) — the same guard manage-light.css needed for its content links:
   `.auth-shell a:hover` (0,2,1) outranks `.auth-shell .btn-primary` (0,2,0),
   so without it the anchor-styled CTA on reset_password_invalid.html took
   --al-blue-dark as its TEXT color while :hover painted the same value as its
   background — an invisible label with a stray underline. Excluding .btn from
   the match means the two rules can never compete on specificity at all. */
.auth-shell a:not(.btn) { color: var(--al-blue); text-decoration: none; font-weight: 700; }
.auth-shell a:not(.btn):hover { color: var(--al-blue-dark); text-decoration: underline; }
.auth-shell .center { text-align: center; margin-top: 1.6rem; }

/* ── step indicator (the 3-screen registration flow) ── */
.auth-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 1.6rem; }
.auth-step { display: flex; align-items: center; gap: 8px; }
.auth-step-dot {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--al-tint); color: var(--al-muted); border: 1px solid var(--al-line);
}
.auth-step-label { font-size: 12px; font-weight: 700; color: var(--al-muted); white-space: nowrap; }
.auth-step-line { width: 22px; height: 2px; border-radius: 2px; background: var(--al-line); }
.auth-step.is-current .auth-step-dot { background: var(--al-blue); border-color: var(--al-blue); color: #fff; }
.auth-step.is-current .auth-step-label { color: var(--al-navy); }
.auth-step.is-done .auth-step-dot { background: #e6e9fd; border-color: #e6e9fd; color: var(--al-blue); }
/* The label of an already-passed step is dropped on narrow screens first —
   it is the least useful of the three, and three full labels wrap badly. */
.auth-step.is-done .auth-step-label { color: var(--al-muted); }

/* ══════════════════════════ Form controls ══════════════════════════ */
.auth-shell .form-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1.1rem 1rem; margin-top: 0;
}
.auth-panel:not(.auth-panel-wide) .form-grid { grid-template-columns: 1fr; }
.auth-shell .form-grid label {
  display: flex; flex-direction: column; gap: .4rem;
  font-size: 12px; font-weight: 700; color: var(--al-muted);
}
.auth-shell .form-grid input,
.auth-shell .form-grid select {
  width: 100%;
  padding: .72rem .85rem; border-radius: 12px;
  border: 1px solid var(--al-line); background: #fdfdff;
  color: var(--al-navy); font-size: 15px; font-weight: 300;
  font-family: var(--al-font);
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.auth-shell .form-grid input::placeholder { color: #b9bed1; }
.auth-shell .form-grid input:hover,
.auth-shell .form-grid select:hover { border-color: #d3dbf7; }
.auth-shell .form-grid input:focus,
.auth-shell .form-grid select:focus {
  /* background-COLOR, not the shorthand: `background: #fff` also resets
     background-image to none, and at this specificity it beat the select's
     own chevron rule below — appearance:none having already removed the
     native arrow, the focused <select> showed no indicator at all. */
  outline: none; background-color: #fff;
  border-color: var(--al-blue);
  box-shadow: 0 0 0 3px rgba(79, 99, 233, .15);
}
/* The focus ring above is a box-shadow, which forced-colors mode strips —
   without this, a high-contrast user gets no focus indicator at all, since
   the rule above also drops the native outline. */
@media (forced-colors: active) {
  .auth-shell .form-grid input:focus,
  .auth-shell .form-grid select:focus { outline: 2px solid Highlight; outline-offset: 1px; }
}
/* Native select arrow, restyled: appearance:none drops it entirely, so the
   chevron is redrawn as a background image on the RTL (left) side. */
.auth-shell .form-grid select {
  appearance: none; -webkit-appearance: none;
  padding-inline-end: 2.2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 7L9 11.5L13.5 7' stroke='%234f63e9' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left .85rem center;
  cursor: pointer;
}
.auth-shell .form-grid small { font-size: 11.5px; font-weight: 300; }

.auth-shell .form-actions { grid-column: 1 / -1; margin-top: .6rem; }
/* A pair of fields that must stay on a row of their own — one of them may be
   hidden, and a hidden cell in the OUTER grid pulls the next field up beside
   its partner and un-pairs everything below it. Same columns and gaps as the
   outer grid, so the seam is invisible. */
.auth-shell .form-pair {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 1fr; gap: 1.1rem 1rem;
}
.auth-panel-wide .form-pair { grid-template-columns: 1fr 1fr; }
.auth-shell .btn {
  border-radius: 10px; font-family: var(--al-font); font-weight: 700;
  transition: background .12s ease, box-shadow .12s ease, transform .08s ease;
}
.auth-shell .btn-primary {
  background: var(--al-blue); color: #fff; border: none;
  box-shadow: 0 6px 18px rgba(79, 99, 233, .22);
}
.auth-shell .btn-primary:hover { background: var(--al-blue-dark); }
.auth-shell .btn-lg {
  width: 100%; height: 48px; padding: 0 1.6rem; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── alerts ── */
.auth-shell .alert {
  background: #fff4f3; border: 1px solid #ffd8d5; color: #cf3a30;
  border-radius: 12px; padding: .8rem 1rem; margin: 0 0 1.2rem;
  font-size: 13.5px; font-weight: 300; line-height: 1.55;
}
.auth-shell .alert-success {
  background: #eef1fe; border-color: #ccd4fb; color: #33409f;
}

/* ── signup perk ── */
/* The registration page's standing notice that every new business lands on
   the same plan with the same 30-day benefit. Deliberately NOT .alert: it is
   not an error and not the result of an action, so it keeps the calm tint
   palette and sits above the form rather than replacing the error slot. */
.auth-shell .signup-perk {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--al-tint); border: 1px solid var(--al-line);
  border-radius: 12px; padding: .85rem 1rem; margin: 0 0 1.2rem;
  font-size: 13px; font-weight: 300; line-height: 1.6; color: var(--al-navy);
}
.auth-shell .signup-perk strong {
  font-size: 13.5px; font-weight: 700; color: var(--al-blue);
}

/* ══════════════════════════ Password fields ══════════════════════════ */
/* Moved here from duplicate inline <style> blocks in register_set_password
   .html and reset_password.html — same rules, one copy, light palette. */
.auth-shell .pw-wrapper { position: relative; display: block; }
.auth-shell .pw-tooltip {
  display: none;
  position: absolute;
  inset-inline-start: 0; top: calc(100% + 8px);
  background: #fff; border: 1px solid var(--al-line); border-radius: 12px;
  padding: 12px 16px; min-width: 250px;
  box-shadow: 0 12px 30px rgba(32, 39, 70, .12);
  z-index: 100; font-size: 12.5px; font-weight: 300; line-height: 1.75;
  color: var(--al-navy); direction: rtl;
}
.auth-shell .pw-tooltip strong { font-weight: 700; font-size: 13px; }
.auth-shell .pw-tooltip ul { margin: 6px 0 0; padding-inline-start: 16px; }
.auth-shell .pw-tooltip li { list-style: disc; }
.auth-shell .pw-tooltip p { margin: 4px 0 0; color: var(--al-muted); }
.auth-shell .pw-wrapper input:focus ~ .pw-tooltip,
.auth-shell .pw-wrapper:focus-within .pw-tooltip { display: block; }
/* password-strength.js sets these two classes on the requirement <li>s and
   writes inline `color` on #pw-hint/#pw2-hint — the inline colors ('green',
   '#c00') are its own and stay as they are; only the class-driven ones are
   re-toned here to the light palette. */
.auth-shell .req-ok { color: #1f9d63; }
.auth-shell .req-fail { color: var(--al-coral); }

/* password-toggle.js injects .pw-toggle-wrap/.pw-toggle-btn with a <style>
   block whose colors fall back to style.css's dark vars — on white, its
   hover state (var(--text) = #f1f5f9) is white-on-white. Its rules are
   single-class, so these scoped ones outrank them without !important. */
.auth-shell .pw-toggle-wrap {
  display: flex; align-items: center; gap: 0;
  position: relative;
}
.auth-shell .pw-toggle-wrap input { padding-inline-end: 2.6rem; }
.auth-shell .pw-toggle-btn {
  position: absolute; inset-inline-end: .55rem;
  width: 1.9rem; height: 1.9rem; border-radius: 8px;
  color: var(--al-muted); background: transparent;
}
.auth-shell .pw-toggle-btn:hover,
.auth-shell .pw-toggle-btn:focus-visible { color: var(--al-blue); background: #eef1fe; }
.auth-shell .pw-toggle-btn:focus-visible { outline: 2px solid var(--al-blue); outline-offset: 1px; }

/* ── 6-digit verification code ── */
/* Matched through .form-grid so it simply outranks the generic input rule
   above, rather than winning on !important. */
.auth-shell .form-grid .code-input {
  text-align: center; font-size: 26px; font-weight: 700;
  letter-spacing: .5em; padding-inline-start: .5em;
  font-variant-numeric: tabular-nums;
}

/* ══════════════════════════ Brand aside ══════════════════════════ */
/* Same gradient family as manage-light.css's .ml-illus-card — these
   illustrations are white-filled line art drawn for a soft blue ground, so
   a saturated panel would swallow them. */
.auth-aside {
  position: relative; overflow: hidden;
  background: linear-gradient(215deg, #b9c3ff 0%, #dfe4ff 45%, #f3f7ff 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 2.5rem;
}
/* two soft blooms, so the flat gradient gets some depth behind the artwork */
.auth-aside::before,
.auth-aside::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.auth-aside::before {
  width: 420px; height: 420px; top: -140px; inset-inline-start: -120px;
  background: radial-gradient(circle, rgba(79, 99, 233, .28) 0%, rgba(79, 99, 233, 0) 70%);
}
.auth-aside::after {
  width: 360px; height: 360px; bottom: -120px; inset-inline-end: -100px;
  background: radial-gradient(circle, rgba(255, 81, 71, .16) 0%, rgba(255, 81, 71, 0) 70%);
}
.auth-aside-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 1.1rem; max-width: 400px;
}
/* Discovery Fs Bold, not the Pil Kahol handwriting face manage-light.css
   uses for its illustration captions: that one is drawn for a 19px accent
   of two or three words and turns into a scribble at headline size. */
.auth-aside-title {
  font-weight: 700; font-size: 33px; line-height: 1.35;
  letter-spacing: -.01em; color: #2a2e56; margin: 0;
}
.auth-aside-title em { font-style: normal; color: var(--al-coral); }
.auth-aside-sub {
  font-size: 14.5px; font-weight: 300; line-height: 1.7; color: #5b628a; margin: 0;
}
.auth-aside-illus { width: 100%; max-width: 290px; height: auto; display: block; }
.auth-aside-points {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
}
.auth-aside-points li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 700; color: #3a4068;
}
.auth-aside-points li::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 16px;
  background: no-repeat center/contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 18 18' fill='none'%3E%3Ccircle cx='9' cy='9' r='8' fill='%234f63e9'/%3E%3Cpath d='M5.5 9.2L8 11.5L12.5 6.5' stroke='white' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ══════════════════════════ Narrow screens ══════════════════════════ */
/* Below the split's breaking point the aside becomes a compact brand strip
   above the form (its illustration and bullet list are decoration, dropped
   rather than shrunk), and the two grid-column pins are released so DOM
   order — aside, then form — is what renders. */
@media (max-width: 900px) {
  /* Both grid-row pins have to be re-stated, not just the columns: leaving
     the desktop `grid-row: 1` in place stacks the two halves into the SAME
     cell, and the aside's gradient covers the form entirely. */
  .auth-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }
  .auth-aside { grid-column: 1; grid-row: 1; }
  .auth-main { grid-column: 1; grid-row: 2; }
  .auth-aside { padding: 1.6rem 1.5rem; min-height: 0; }
  .auth-aside-illus, .auth-aside-points { display: none; }
  .auth-aside-title { font-size: 24px; }
  .auth-aside-sub { font-size: 13px; }
  .auth-main { padding: 2.2rem 1.4rem 3rem; justify-content: flex-start; }
  .auth-logo { margin-bottom: 1.6rem; }
  .auth-logo img { width: 150px; }
  .auth-head h1 { font-size: 25px; }
  .auth-panel-wide .form-grid,
  .auth-panel-wide .form-pair { grid-template-columns: 1fr; }
  .auth-step.is-done .auth-step-label { display: none; }
}
@media (max-width: 420px) {
  /* Only the current step keeps its label at this width — three of them no
     longer fit, but a bare "3 — 2 — 1" says nothing on its own. */
  .auth-step:not(.is-current) .auth-step-label { display: none; }
  .auth-step-line { width: 14px; }
}
