/* Login and first-run setup (#/login, #/setup): a brand panel beside the sign-in panel on wide screens, one column
   on phones (the brand panel becomes a short band above the sign-in). Page-only classes use the auth- prefix.
   The brand panel is the same deep green in both themes (white text on it), like the logo tile. */

.auth-layout {
  min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(400px, 44%) minmax(0, 1fr);
  background: var(--surface);
}

/* ---------------------------------------------------------------- brand panel */

.auth-hero {
  position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; gap: var(--space-8);
  padding: var(--space-10) var(--space-12) var(--space-8); color: #fff;
  background:
    radial-gradient(520px 420px at 105% 105%, rgba(146, 208, 80, .16), transparent 70%),
    radial-gradient(640px 460px at -10% -12%, rgba(62, 169, 123, .55), transparent 70%),
    linear-gradient(160deg, var(--green-600) 0%, var(--green-800) 56%, var(--green-900) 100%);
}
/* dark theme: a deeper green, so the panel doesn't glare beside the dark sign-in side */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-hero {
    background:
      radial-gradient(520px 420px at 105% 105%, rgba(146, 208, 80, .10), transparent 70%),
      radial-gradient(640px 460px at -10% -12%, rgba(31, 143, 96, .45), transparent 70%),
      linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 58%, #072a1c 100%);
  }
}
:root[data-theme="dark"] .auth-hero {
  background:
    radial-gradient(520px 420px at 105% 105%, rgba(146, 208, 80, .10), transparent 70%),
    radial-gradient(640px 460px at -10% -12%, rgba(31, 143, 96, .45), transparent 70%),
    linear-gradient(160deg, var(--green-700) 0%, var(--green-900) 58%, #072a1c 100%);
}
/* a faint grid, fading out towards the edges */
.auth-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 70% at 30% 40%, #000 20%, transparent 75%);
}
.auth-hero-brand { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-lg); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
.auth-hero-brand .logo-mark { width: 40px; height: 40px; filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .25)); }
.auth-hero-body { display: flex; flex-direction: column; gap: var(--space-4); max-width: 460px; margin: auto 0; }
.auth-hero-title { font-size: 32px; font-weight: var(--fw-bold); line-height: 1.12; letter-spacing: -0.025em; text-wrap: balance; }
.auth-hero-text { font-size: var(--fs-lg); line-height: 1.55; color: rgba(255, 255, 255, .84); max-width: 42ch; }
.auth-hero-points { list-style: none; display: flex; flex-direction: column; gap: var(--space-2-5); margin-top: var(--space-2); }
.auth-hero-point { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-md); color: rgba(255, 255, 255, .94); }
.auth-hero-point-icon {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .10); border: 1px solid rgba(255, 255, 255, .16); color: var(--lime-400);
}
.auth-hero-point-icon .icon { width: 18px; height: 18px; }
.auth-hero-foot { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--fs-xs); color: rgba(255, 255, 255, .72); }

/* a payslip, as the bot sends it: a picture only (aria-hidden), in fixed light colours */
.auth-art { position: relative; width: 300px; max-width: 100%; margin-top: var(--space-6); }
.auth-slip {
  position: relative; display: flex; flex-direction: column; gap: var(--space-2-5); padding: var(--space-4) var(--space-5);
  background: #ffffff; color: #0f1722; border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px -16px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .12);
  transform: rotate(-2deg); transform-origin: 30% 80%;
}
.auth-slip-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.auth-slip-eyebrow { font-size: 11px; font-weight: var(--fw-semibold); letter-spacing: .06em; text-transform: uppercase; color: #636d7d; }
.auth-slip-sent {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 var(--space-2); border-radius: var(--radius-full);
  font-size: 11px; font-weight: var(--fw-semibold); color: #0d6139; background: #e6f4ec; border: 1px solid #b5dfc7;
}
.auth-slip-sent .icon { width: 12px; height: 12px; }
.auth-slip-name { font-size: var(--fs-md); font-weight: var(--fw-semibold); line-height: 1.25; }
.auth-slip-name small { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: #556070; }
.auth-slip-rows { display: flex; flex-direction: column; gap: 6px; padding-top: var(--space-2); border-top: 1px dashed #cfd6e0; }
.auth-slip-row { display: flex; justify-content: space-between; gap: var(--space-3); font-size: var(--fs-sm); color: #475263; font-variant-numeric: tabular-nums; }
.auth-slip-total {
  display: flex; justify-content: space-between; gap: var(--space-3); margin-top: 2px; padding: var(--space-1-5) var(--space-2-5);
  border-radius: var(--radius-sm); background: var(--lime-500); color: #1e3a07; font-size: var(--fs-sm);
  font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.auth-art-bubble {
  position: absolute; right: -18px; bottom: -16px; display: inline-flex; align-items: center; gap: var(--space-1-5);
  padding: var(--space-1-5) var(--space-3); border-radius: var(--radius-full); background: #0f1722; color: #e7ebf0;
  font-size: var(--fs-xs); font-weight: var(--fw-medium); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .5);
}
.auth-art-bubble .icon { width: 14px; height: 14px; color: #6aa1ff; }

/* ---------------------------------------------------------------- sign-in panel */

.auth-side {
  display: flex; flex-direction: column; align-items: center; min-width: 0;
  padding: var(--space-8) var(--space-6) var(--space-6); background: var(--surface);
}
.auth-main { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; width: 100%; max-width: 400px; padding: var(--space-6) 0; }
.auth-card { display: flex; flex-direction: column; gap: var(--space-6); }
.auth-mobile-brand { display: none; }
.auth-card-head { display: flex; flex-direction: column; gap: var(--space-2); }
.auth-card-title { font-size: var(--fs-3xl); font-weight: var(--fw-semibold); letter-spacing: -0.02em; line-height: 1.15; }
.auth-card-title:focus { outline: none; }
.auth-card-text { color: var(--text-muted); font-size: var(--fs-md); line-height: 1.5; }
.auth-icon {
  display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: var(--space-2); border-radius: var(--radius-lg);
  background: var(--primary-soft); color: var(--primary-text); border: 1px solid var(--primary-border);
}
.auth-icon.is-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.auth-notice:empty { display: none; }
.auth-notice .callout-text strong { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
/* a second paragraph: how to get in anyway (e.g. the break-glass password) */
.auth-notice-fine { display: block; margin-top: var(--space-2); font-size: var(--fs-sm); opacity: .85; }
.auth-cmd { font-family: var(--font-mono); font-size: .9em; }
.auth-cmd > span { white-space: nowrap; }

/* "or" between the provider buttons and the password */
.auth-or {
  display: flex; align-items: center; gap: var(--space-3); color: var(--text-subtle); font-size: var(--fs-xs);
  font-weight: var(--fw-medium); letter-spacing: .06em; text-transform: uppercase;
}
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* "Use the app password" (when Microsoft / Google are offered too): a disclosure */
.auth-password { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-password-toggle {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2); width: 100%; min-height: 40px;
  padding: 0 var(--space-3); border: 0; border-radius: var(--radius); background: transparent; color: var(--text-muted);
  font-size: var(--fs-base); font-weight: var(--fw-medium);
}
.auth-password-toggle:hover { background: var(--surface-3); color: var(--text); }
.auth-password-toggle .icon { width: 16px; height: 16px; transition: transform var(--dur) var(--ease); }
.auth-password-toggle[aria-expanded="true"] { color: var(--text); }
.auth-password-toggle[aria-expanded="true"] .icon:last-child { transform: rotate(180deg); }
.auth-password-form { animation: page-in var(--dur) var(--ease); }
/* the form's message line takes no room (and adds no gap) until there is something to say */
.auth-card form > [aria-live]:empty { display: none; }

.auth-steps { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding-left: var(--space-5); color: var(--text); }
.auth-steps li::marker { color: var(--text-subtle); font-weight: var(--fw-semibold); }
.auth-check { display: flex; align-items: center; gap: var(--space-2); }
.auth-checks { list-style: none; }
.auth-fine { font-size: var(--fs-sm); color: var(--text-muted); }

.auth-foot {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--space-1-5) var(--space-2);
  color: var(--text-subtle); font-size: var(--fs-xs); text-align: center;
}
.auth-foot .icon { flex: none; }
.auth-foot-version { display: none; }

/* ---------------------------------------------------------------- short screens, tablets and phones */

@media (min-width: 821px) and (max-height: 760px) {
  .auth-art { display: none; }
}

@media (max-width: 1080px) {
  .auth-layout { grid-template-columns: minmax(340px, 40%) minmax(0, 1fr); }
  .auth-hero { padding: var(--space-8); }
  .auth-hero-title { font-size: 28px; }
  .auth-art { display: none; }
}
@media (max-width: 820px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-hero { gap: var(--space-3); padding: var(--space-6) var(--space-6) var(--space-8); }
  .auth-hero-body { margin: 0; gap: var(--space-2); }
  .auth-hero-title { font-size: var(--fs-xl); letter-spacing: -0.01em; }
  .auth-hero-text { font-size: var(--fs-base); }
  .auth-hero-points, .auth-hero-foot { display: none; }
  /* the sign-in panel overlaps the band a little, as a sheet */
  .auth-side {
    position: relative; margin-top: calc(-1 * var(--space-4)); padding: var(--space-6) var(--space-4) var(--space-5);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: 0 -8px 24px -12px rgba(0, 0, 0, .3);
  }
  .auth-main { justify-content: flex-start; padding: var(--space-2) 0 var(--space-8); }
  .auth-card { gap: var(--space-5); }
  .auth-card-title { font-size: var(--fs-2xl); }
  .auth-foot-version { display: inline; }
}
@media (max-width: 420px) {
  .auth-hero { padding: var(--space-5) var(--space-4) var(--space-8); }
  .auth-hero-brand { font-size: var(--fs-md); }
  .auth-hero-brand .logo-mark { width: 32px; height: 32px; }
  .auth-hero-text { display: none; }
}

@media (forced-colors: active) {
  .auth-hero { border-right: 1px solid CanvasText; }
  .auth-slip, .auth-art-bubble { border: 1px solid CanvasText; }
}
