/* Calvert Fleet Management — themed sign-in landing.
   Theme-aware via CSS custom-property tokens: prefers-color-scheme sets the default,
   and a data-theme attribute (stamped by signin.js) wins over it in both directions.
   The brand panel keeps its own committed dark-blue world in both themes. */

:root {
  /* blue-biased neutrals */
  --ground: #f6f8fc;
  --panel: #ffffff;
  --ink: #0f1b2d;
  --ink-soft: #47566b;
  --ink-faint: #7d8aa0;
  --line: #e3e9f2;
  --line-strong: #d2dbea;
  --accent: #006deb;      /* Calvert blue */
  --accent-press: #005ac4;
  --accent-tint: #eaf2ff;
  --focus: #2b8bff;
  /* brand panel (its own committed dark-blue world in both themes) */
  --brand-1: #0a3d8f;
  --brand-2: #073070;
  --brand-3: #0b52c0;
  --brand-node: #7fb4ff;
  --brand-ink: #eaf1ff;
  --brand-ink-soft: #a9c4f0;
  --shadow: 0 24px 60px -28px rgba(10, 40, 90, .45);
  --card-radius: 18px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0a1220;
    --panel: #101a2c;
    --ink: #eaf0fa;
    --ink-soft: #a7b4c9;
    --ink-faint: #6f7d94;
    --line: #1e2a40;
    --line-strong: #29384f;
    --accent: #3d8bff;
    --accent-press: #2f79ea;
    --accent-tint: #16233c;
    --focus: #5aa2ff;
    --brand-1: #0b2a5c;
    --brand-2: #061d43;
    --brand-3: #0e47a0;
    --brand-ink: #eaf1ff;
    --brand-ink-soft: #9db9e6;
    --shadow: 0 26px 70px -30px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="light"] {
  --ground: #f6f8fc; --panel: #fff; --ink: #0f1b2d; --ink-soft: #47566b; --ink-faint: #7d8aa0;
  --line: #e3e9f2; --line-strong: #d2dbea; --accent: #006deb; --accent-press: #005ac4;
  --accent-tint: #eaf2ff; --focus: #2b8bff;
  --brand-1: #0a3d8f; --brand-2: #073070; --brand-3: #0b52c0; --brand-ink: #eaf1ff; --brand-ink-soft: #a9c4f0;
  --shadow: 0 24px 60px -28px rgba(10, 40, 90, .45);
}
:root[data-theme="dark"] {
  --ground: #0a1220; --panel: #101a2c; --ink: #eaf0fa; --ink-soft: #a7b4c9; --ink-faint: #6f7d94;
  --line: #1e2a40; --line-strong: #29384f; --accent: #3d8bff; --accent-press: #2f79ea;
  --accent-tint: #16233c; --focus: #5aa2ff;
  --brand-1: #0b2a5c; --brand-2: #061d43; --brand-3: #0e47a0; --brand-ink: #eaf1ff; --brand-ink-soft: #9db9e6;
  --shadow: 0 26px 70px -30px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}

/* ---------- brand panel ---------- */
.brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 12%, var(--brand-3) 0%, transparent 55%),
    linear-gradient(150deg, var(--brand-1) 0%, var(--brand-2) 100%);
  color: var(--brand-ink);
  padding: clamp(28px, 4vw, 56px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}
.brand canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; opacity: .9;
}
.brand::after { /* soft vignette to seat the type */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(90% 70% at 30% 40%, transparent 40%, rgba(3, 18, 45, .35) 100%);
}
.wordmark-img { height: 30px; width: auto; display: block; align-self: flex-start; flex: none; object-fit: contain; }
@media (max-width: 860px) { .wordmark-img { height: 26px; } }

.brand-hero { max-width: 30ch; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .22em; font-size: 12px; font-weight: 600;
  color: var(--brand-ink-soft);
}
.brand h1 {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: .35em 0 .5em;
  text-wrap: balance;
  font-weight: 750;
}
.brand h1 em { font-style: normal; color: #ffffff; }
.tagline { font-size: clamp(15px, 1.5vw, 18px); color: var(--brand-ink-soft); line-height: 1.5; max-width: 34ch; }

.cred-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cred {
  font-size: 11.5px; letter-spacing: .04em; font-weight: 600;
  color: var(--brand-ink-soft);
  border: 1px solid rgba(170, 196, 240, .28);
  border-radius: 999px; padding: 6px 12px;
  background: rgba(255,255,255,.04);
}

@media (max-width: 860px) {
  .brand { padding: 24px; gap: 22px; }
  .brand-hero { max-width: none; }
  .brand h1 { margin: .3em 0 .35em; }
  .tagline { display: none; }
}

/* ---------- auth panel ---------- */
.auth {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  position: relative;
}
.theme-toggle {
  position: absolute; top: 20px; right: 20px;
  background: var(--panel); color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font: inherit; font-size: 13px; padding: 7px 14px; cursor: pointer;
  display: inline-flex; gap: 7px; align-items: center;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.card {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow);
  padding: clamp(26px, 3vw, 38px);
  display: flex; flex-direction: column; gap: 22px;
}
.card h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; font-weight: 700; }
.card .sub { margin: 4px 0 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }

.btn {
  appearance: none; font: inherit; cursor: pointer; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 11px;
  border-radius: 11px; padding: 13px 16px; font-weight: 650; font-size: 15px;
  border: 1px solid transparent; transition: background .14s, border-color .14s, transform .04s;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-ms { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn-ms:hover { border-color: var(--accent); background: var(--accent-tint); }
.btn svg { flex: none; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

.customer {
  text-align: center; font-size: 14px; color: var(--ink-soft);
}
.customer a { color: var(--accent); font-weight: 650; text-decoration: none; }
.customer a:hover { text-decoration: underline; }

.assure {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--ink-faint); font-size: 12.5px; line-height: 1.4; text-align: center;
}
.assure svg { flex: none; color: var(--accent); }

/* Development-only one-click sign-in helpers (never rendered outside Development). */
.dev-panel {
  border: 1px dashed var(--line-strong); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.dev-panel .dev-label {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700;
  color: #b8860b;
}
.dev-panel .dev-links { display: flex; flex-wrap: wrap; gap: 8px; }
.dev-panel a {
  font-size: 13px; color: var(--ink); text-decoration: none;
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 10px;
  background: var(--ground);
}
.dev-panel a:hover { border-color: var(--accent); color: var(--accent); }

.foot {
  margin-top: 26px; color: var(--ink-faint); font-size: 12px;
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center;
}
.foot .sep { opacity: .5; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) { .brand canvas { display: none; } }
