/* public/shared/login.css
 *
 * THE SIGN-IN PAGE (6 November 2026, from Claude Design's "dot pattern"
 * design). A brand panel on the left (on top on a phone) and a plain form on
 * the right. Only --brand changes between businesses (set by
 * /shared/login-brands.js); every other brand shade is mixed from it here.
 * Light and dark follow the device, or data-theme="light" / "dark" on <html>.
 *
 * Two departures from the design's numbers, both for contrast with the real
 * brand colours, which are lighter than the ones it guessed:
 *   - the dark-mode button is the brand with 18% black, not the plain brand
 *     (white on plain Yorkshire blue or Kovi teal is only 3.6:1; this is 5:1)
 *   - the small white text on the panel is 88% white, not 75%
 */

:root {
  --brand: #3d5a73;
  --logo-h: 56px;
  --logo-h-phone: 44px;

  color-scheme: light;
  --bg: #ffffff;
  --text: #141821;
  --muted: #5b6472;
  --label: #2a303b;
  --input-bg: #ffffff;
  --input-border: #cfd4dc;
  --divider: #e6e9ee;
  --accent: color-mix(in srgb, var(--brand) 65%, black);
  --link: var(--accent);
  --button: var(--accent);
  --panel-from: color-mix(in srgb, var(--brand) 90%, black);
  --panel-to: color-mix(in srgb, var(--brand) 60%, black);
  --panel-glow: color-mix(in srgb, var(--brand) 78%, white);
  --error: #b42318;
  --error-bg: #fef3f2;
  --error-border: #f4c7c3;
  --info-bg: color-mix(in srgb, var(--brand) 8%, white);
  --info-border: color-mix(in srgb, var(--brand) 30%, white);
  --chip-bg: #f4f6f8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10151b;
    --text: #f2f4f7;
    --muted: #a3acb9;
    --label: #d5dae1;
    --input-bg: #171e26;
    --input-border: #2e3844;
    --divider: #232b35;
    --link: color-mix(in srgb, var(--brand) 50%, white);
    --button: color-mix(in srgb, var(--brand) 82%, black);
    --panel-from: color-mix(in srgb, var(--brand) 70%, black);
    --panel-to: color-mix(in srgb, var(--brand) 28%, black);
    --panel-glow: color-mix(in srgb, var(--brand) 95%, black);
    --error: #ff9b91;
    --error-bg: #2a1614;
    --error-border: #5c2621;
    --info-bg: color-mix(in srgb, var(--brand) 14%, #10151b);
    --info-border: color-mix(in srgb, var(--brand) 40%, #10151b);
    --chip-bg: #171e26;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10151b;
  --text: #f2f4f7;
  --muted: #a3acb9;
  --label: #d5dae1;
  --input-bg: #171e26;
  --input-border: #2e3844;
  --divider: #232b35;
  --link: color-mix(in srgb, var(--brand) 50%, white);
  --button: color-mix(in srgb, var(--brand) 82%, black);
  --panel-from: color-mix(in srgb, var(--brand) 70%, black);
  --panel-to: color-mix(in srgb, var(--brand) 28%, black);
  --panel-glow: color-mix(in srgb, var(--brand) 95%, black);
  --error: #ff9b91;
  --error-bg: #2a1614;
  --error-border: #5c2621;
  --info-bg: color-mix(in srgb, var(--brand) 14%, #10151b);
  --info-border: color-mix(in srgb, var(--brand) 40%, #10151b);
  --chip-bg: #171e26;
}

/* ===== Layout ===== */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.login {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

/* ===== Brand panel ===== */
.brand-panel {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  color: #ffffff;
  background:
    radial-gradient(rgba(255,255,255,0.16) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    radial-gradient(circle at 20% 15%, var(--panel-glow) 0%, transparent 55%),
    linear-gradient(160deg, var(--panel-from) 0%, var(--panel-to) 100%);
}
.brand-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.25) 100%);
  pointer-events: none;
}
.brand-panel > * { position: relative; z-index: 1; }

/* A fixed slot for the logo, so the heading below sits in the same place for
   every business whatever its logo's shape (Shaun, 6 November 2026). */
.brand-mark { height: 72px; display: flex; align-items: center; }
.brand-logo { display: block; height: var(--logo-h); width: auto; max-width: 280px; }
.brand-wordmark { display: flex; flex-direction: column; gap: 2px; }
.brand-wordmark span:first-child { font-size: 22px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1; }
.brand-wordmark span:last-child:not(:first-child) { font-size: 12px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.9; }

.brand-intro { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.brand-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.88); }
.brand-title { margin: 0; font-size: 52px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.02; }
.brand-tagline { margin: 0; font-size: 17px; line-height: 1.5; color: rgba(255,255,255,0.92); }
.brand-copyright { margin: 0; font-size: 12px; color: rgba(255,255,255,0.88); min-height: 1em; }

/* ===== Form side ===== */
.form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}
.form-wrap { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 28px; }
.form-heading { display: flex; flex-direction: column; gap: 6px; }
.form-heading h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.01em; }
.form-heading p { margin: 0; font-size: 15px; color: var(--muted); }

.step { display: none; flex-direction: column; gap: 20px; }
.step.active { display: flex; }
.step-note { margin: 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.step-note.with-icon { display: flex; align-items: flex-start; gap: 10px; }
.step-note.with-icon svg { flex: none; margin-top: 2px; color: var(--link); }

.form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--label); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap svg { position: absolute; left: 16px; color: var(--muted); pointer-events: none; }
.input-wrap input {
  width: 100%;
  height: 52px;
  padding: 0 16px 0 46px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* 16px stops iPhones zooming in on the field */
}
.input-wrap.no-icon input { padding-left: 16px; }
.input-wrap input::placeholder { color: var(--muted); opacity: 0.8; }
.input-wrap input:focus { outline: 2px solid var(--link); outline-offset: 1px; border-color: transparent; }
.input-wrap input[aria-invalid="true"] { border-color: var(--error); }
.input-wrap input.code-input { text-align: center; font-size: 24px; font-weight: 600; letter-spacing: 0.4em; padding-left: 16px; font-variant-numeric: tabular-nums; }

.btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: var(--button);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: filter 0.15s, transform 0.15s;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.btn-primary:disabled { cursor: progress; filter: saturate(0.6); opacity: 0.85; }
.btn-primary[hidden] { display: none; }

/* Who you are signing in as, on the later steps */
.identity-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  background: var(--chip-bg);
  font-size: 14px;
}
.identity-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

.link-btn, .auth-link {
  background: none;
  border: none;
  padding: 4px 2px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-btn:hover, .auth-link:hover { text-decoration-thickness: 2px; }
.link-btn:focus-visible, .auth-link:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.auth-link.quiet { color: var(--muted); font-weight: 500; }
.footer-row { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; }
.footer-row.split { justify-content: space-between; }

/* Messages */
.msg { display: none; margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.msg.show { display: block; }
.msg.error { color: var(--error); background: var(--error-bg); border-color: var(--error-border); }
.msg.info { color: var(--text); background: var(--info-bg); border-color: var(--info-border); }

.form-footer { margin: 0; padding-top: 20px; border-top: 1px solid var(--divider); font-size: 14px; color: var(--muted); }
.form-footer a { color: var(--link); font-weight: 600; }
.form-footer a:hover { text-decoration-thickness: 2px; }
.form-footer a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }
.form-side { position: relative; }
/* The help line sits at the foot of the form side, level with the copyright
   line on the panel, so whether a business has one never moves the form. */
.support { position: absolute; left: 0; right: 0; bottom: 48px; margin: 0 auto; width: calc(100% - 48px); max-width: 380px; font-size: 13px; color: var(--muted); }
.support[hidden] { display: none; }
.support { line-height: 1.6; }
.support a { white-space: nowrap; }
.support a { color: var(--link); font-weight: 600; }
.secure-note { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }

/* ===== Phone ===== */
@media (max-width: 640px) {
  .brand-panel { min-height: 240px; padding: 32px 24px; gap: 28px; }
  .brand-title { font-size: 36px; }
  .brand-tagline { font-size: 15px; }
  .brand-mark { height: 50px; }
  .brand-logo { height: var(--logo-h-phone); }
  .brand-tagline br { display: none; }
  .form-side { padding: 36px 20px 48px; }
  .support { position: static; width: 100%; margin-top: 24px; }
}
