/* Self-hosted, as every other font on these pages is: the portal must not call
   fonts.googleapis.com (it leaked user IPs and would widen the CSP). */
@font-face{font-family:'Space Grotesk Variable';font-style:normal;font-weight:400 700;font-display:swap;
  src:url('/auth/assets/fonts/space-grotesk-variable.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Sans Variable';font-style:normal;font-weight:400 600;font-display:swap;
  src:url('/auth/assets/fonts/ibm-plex-sans-variable.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:400;font-display:swap;
  src:url('/auth/assets/fonts/ibm-plex-mono-400.woff2') format('woff2');}
@font-face{font-family:'IBM Plex Mono';font-style:normal;font-weight:500;font-display:swap;
  src:url('/auth/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');}

.font-display{font-family:'Space Grotesk Variable','Space Grotesk',sans-serif;}
.font-ui{font-family:'IBM Plex Sans Variable','IBM Plex Sans',sans-serif;}
.font-data{font-family:'IBM Plex Mono',ui-monospace,monospace;}

/* iTech semantic design tokens — from design_handoff_itech_platform/tokens.css.
 *
 * The handoff sheet keys light off `[data-theme="light"]`; this portal has always
 * toggled a `.dark` class on <html> (see providers/ThemeProvider.tsx and
 * public/theme-init.js), so the two blocks are mapped onto that instead of
 * introducing a second, competing theme attribute.
 *
 * Dark stays in bare `:root` rather than under `.dark`, so the no-JS / pre-paint
 * default is dark — which is what theme-init.js and the stored default already
 * do. Light is `:root:not(.dark)`; it wins by specificity when the class is off.
 *
 * Density and accent are the two runtime dials: `data-density` on <html> (one
 * level per screen, per the handoff) and `--accent` set on <html> by the accent
 * picker. Everything else is derived, so changing either re-tints the whole UI.
 */

/* ── dark (default) ─────────────────────────────────────────────────────── */
:root {
  --bg-signin: url('/auth/assets/bg-signin-dark.png');
  --bg-app: url('/auth/assets/bg-dark-authenticated.png');

  --solid: #141821;
  --surface: rgba(20, 24, 33, 0.74);
  --surface-2: rgba(26, 31, 42, 0.92);
  --surface-3: rgba(12, 15, 21, 0.72);

  --border: rgba(255, 255, 255, 0.10);
  --border-2: rgba(255, 255, 255, 0.20);

  --ink: #f2f4f8;
  --ink-2: #a3aabb;
  --ink-3: #8e96a8;

  /* Overridden on <html> by the accent picker; this is Cobalt, pair 0 dark. */
  --accent: #5b7cff;
  --accent-ink: #06090f;

  --ok: #3dd68c;
  --warn: #f5b544;
  --danger: #ff7a85;
  --priv: #c08bff;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 18px 44px -18px rgba(0, 0, 0, 0.75);

  --scrim: rgba(0, 0, 0, 0.38);
  --glass: rgba(18, 19, 28, 0.62);
  --glass-bar: rgba(18, 19, 28, 0.55);
  --glass-hi: rgba(255, 255, 255, 0.08);
  --glass-shadow: inset 0 1px 0 var(--glass-hi), 0 24px 60px rgba(0, 0, 0, 0.45);
  --glass-bar-shadow: inset 0 -1px 0 var(--border), inset 0 1px 0 var(--glass-hi);

  /* The focus ring is accent-tinted, so it follows the accent picker rather than
     staying cobalt when someone chooses Teal. The handoff quotes the resolved
     cobalt values (.45 dark / .35 light); these mixes reproduce them. */
  --ring: color-mix(in oklab, var(--accent), transparent 55%);
}

/* ── light ──────────────────────────────────────────────────────────────── */
:root:not(.dark) {
  --bg-signin: url('/auth/assets/bg-signin-light.jpg');
  --bg-app: url('/auth/assets/bg-light-authenticated.png');

  --solid: #ffffff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-2: rgba(255, 255, 255, 0.96);
  --surface-3: rgba(244, 245, 249, 0.78);

  --border: rgba(18, 22, 32, 0.10);
  --border-2: rgba(18, 22, 32, 0.20);

  --ink: #12161f;
  --ink-2: #575e71;
  --ink-3: #5d6478;

  --accent: #1740c9;
  --accent-ink: #ffffff;

  --ok: #00734b;
  --warn: #8a5200;
  --danger: #c42b3d;
  --priv: #7233be;

  --shadow-1: 0 1px 2px rgba(18, 22, 32, 0.06);
  --shadow-2: 0 18px 44px -20px rgba(18, 22, 32, 0.28);

  --scrim: rgba(255, 255, 255, 0.34);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-bar: rgba(255, 255, 255, 0.60);
  --glass-hi: rgba(255, 255, 255, 0.70);
  --glass-shadow: inset 0 1px 0 var(--glass-hi), 0 24px 60px rgba(18, 22, 32, 0.10);
  --glass-bar-shadow: inset 0 -1px 0 var(--border), inset 0 1px 0 var(--glass-hi);

  --ring: color-mix(in oklab, var(--accent), transparent 65%);
}

/* ── derived + density (identical in both themes) ───────────────────────── */
:root {
  --accent-h: color-mix(in oklab, var(--accent), #000 16%);
  --accent-soft: color-mix(in oklab, var(--accent), var(--solid) 86%);
  --accent-line: color-mix(in oklab, var(--accent), var(--solid) 60%);
  --ok-soft: color-mix(in oklab, var(--ok), var(--solid) 86%);
  --warn-soft: color-mix(in oklab, var(--warn), var(--solid) 86%);
  --danger-soft: color-mix(in oklab, var(--danger), var(--solid) 86%);
  --priv-soft: color-mix(in oklab, var(--priv), var(--solid) 88%);

  /* The identity gradients. --ai is only ever a 1px masked stroke or a small
     tile fill — never a wash behind text. --spectrum appears once per screen. */
  --ai: linear-gradient(135deg, var(--priv) 0%, var(--accent) 55%, #47e5bc 100%);
  --spectrum: linear-gradient(90deg, #ff5f6d, #ffc371, #47e5bc, var(--accent));

  /* comfortable — the default level */
  --rh: 44px;
  --cpad: 20px;
  --fs: 14px;
  --gap: 16px;
}

:root[data-density='operational'] { --rh: 38px; --cpad: 14px; --fs: 13px; --gap: 10px; }
:root[data-density='focused']     { --rh: 48px; --cpad: 24px; --fs: 15px; --gap: 20px; }

/* Motion is 140–200ms ease throughout; honour the OS setting. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── surfaces ───────────────────────────────────────────────────────────── */
/* Three glass weights from the handoff. -webkit- is duplicated on every one:
   Safari still needs the prefix, and without it the panel renders as a flat
   translucent box with no blur at all. */
.itech-glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  backdrop-filter: blur(28px) saturate(1.4);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--border);
}
.itech-glass-bar {
  background: var(--glass-bar);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: var(--glass-bar-shadow);
}
.itech-card {
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid var(--border);
}

/* The AI gradient as a 1px ring, never a fill behind text: the gradient paints
   the padding box and a mask punches out the content box, leaving the border. */
.itech-ai-stroke { position: relative; }
.itech-ai-stroke::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--ai);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* The spectrum hairline — once per screen, on a panel's top edge. */
.itech-spectrum-edge { position: relative; }
.itech-spectrum-edge::after {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: var(--spectrum);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  pointer-events: none;
}

/* Every control carries the same focus ring. */
.itech-focus:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ── motion ─────────────────────────────────────────────────────────────── */
@keyframes itech-shimmer { from { background-position: -420px 0; } to { background-position: 420px 0; } }
@keyframes itech-pulse   { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@keyframes itech-rise    { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.itech-skeleton {
  background: linear-gradient(90deg, var(--border), var(--border-2), var(--border));
  background-size: 420px 100%;
  animation: itech-shimmer 1.4s linear infinite;
}
.itech-pulse { animation: itech-pulse 1.4s ease-in-out infinite; }
.itech-rise  { animation: itech-rise .16s ease-out both; }

/* ── classes for the static auth pages ──────────────────────────────────────
   These pages run under `style-src-attr 'none'` — inline style attributes are
   deliberately blocked — so every token-driven value used by login.html has to
   be a real class. Same reason util.css exists. Do not reintroduce style="".  */
.i-art-signin{background-image:var(--bg-signin);background-size:cover;background-position:center;}
.i-scrim{background:var(--scrim);-webkit-backdrop-filter:blur(6px) saturate(1.3);backdrop-filter:blur(6px) saturate(1.3);}

.i-ink{color:var(--ink);} .i-ink-2{color:var(--ink-2);} .i-ink-3{color:var(--ink-3);}
.i-accent{color:var(--accent);}
.i-hairline{border-color:var(--border);}

.i-eyebrow{font-family:'IBM Plex Mono',ui-monospace,monospace;font-size:10px;letter-spacing:.18em;text-transform:uppercase;color:var(--ink-3);}
.i-eyebrow-rule{display:inline-block;width:34px;height:2px;border-radius:2px;background:var(--spectrum);}

.i-h1{font-family:'Space Grotesk Variable','Space Grotesk',sans-serif;font-weight:600;
  font-size:clamp(36px,4.4vw,54px);line-height:1.04;letter-spacing:-.03em;color:var(--ink);}
.i-h2{font-family:'Space Grotesk Variable','Space Grotesk',sans-serif;font-weight:600;letter-spacing:-.01em;color:var(--ink);}

.i-tile{display:grid;place-items:center;border-radius:9px;background:var(--accent-soft);color:var(--accent);}
.i-tile-lg{width:42px;height:42px;border-radius:12px;}
.i-tile-sm{width:32px;height:32px;}
.i-tile-ai{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--ai);color:#fff;}

.i-panel{border-radius:16px;background:var(--glass);
  -webkit-backdrop-filter:blur(28px) saturate(1.4);backdrop-filter:blur(28px) saturate(1.4);
  box-shadow:var(--glass-shadow);}

/* Google button — the handoff's exact shape: 48px, 40px/1fr/40px, centred label. */
.i-gbtn{display:grid;grid-template-columns:40px 1fr 40px;align-items:center;height:48px;
  border-radius:12px;background:#FFFFFF;border:1px solid #DADCE0;text-decoration:none;
  transition:box-shadow .15s ease, transform .15s ease;}
.i-gbtn:hover{transform:translateY(-1px);box-shadow:0 6px 18px -6px var(--ring);}
.i-gchip{display:grid;place-items:center;width:32px;height:32px;border-radius:999px;background:#F1F3F4;margin-left:8px;}
.i-glabel{text-align:center;font-size:14px;font-weight:600;color:#1F1F1F;}
.i-mark-tile{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:var(--accent);color:var(--accent-ink);}
.i-divider{display:inline-block;width:1px;height:16px;background:var(--border-2);}
.i-btn-primary{border-radius:11px;background:var(--accent);color:var(--accent-ink);
  font-family:'IBM Plex Sans Variable','IBM Plex Sans',sans-serif;font-weight:600;font-size:14px;
  transition:background-color .15s ease,transform .15s ease;}
.i-btn-primary:hover{background:var(--accent-h);transform:translateY(-1px);}

/* ── sign-in: interactive example, layer tabs, dialog ────────────────────── */
.i-step{display:inline-flex;align-items:center;gap:7px;height:32px;padding:0 11px;border-radius:8px;
  border:1px solid transparent;background:transparent;color:var(--ink-2);
  font-family:'IBM Plex Sans Variable','IBM Plex Sans',sans-serif;font-size:12.5px;font-weight:600;
  cursor:pointer;transition:background-color .15s ease,color .15s ease;}
.i-step:hover{color:var(--ink);}
.i-step[aria-pressed="true"]{background:var(--accent-soft);color:var(--ink);}
.i-step-n{display:grid;place-items:center;width:18px;height:18px;border-radius:999px;flex:none;
  background:var(--border);color:inherit;font-family:'IBM Plex Mono',monospace;font-size:10px;}
.i-step[aria-pressed="true"] .i-step-n{background:var(--accent);color:var(--accent-ink);}

/* No reserved height. It was 212px, then 172px, and on the first step — which
   is two short lines — that was ~96px of empty panel. The steps differ enough
   in length that no single figure avoids a gap on one of them, so the panel
   sizes to its step and the slight resize is the honest option. */
.i-demo-body{min-height:0;}
.i-note{display:flex;align-items:center;gap:9px;padding:11px 13px;border-radius:11px;
  border:1px dashed var(--border-2);}
.i-dots{display:inline-flex;gap:4px;}
.i-dots i{width:5px;height:5px;border-radius:999px;background:var(--accent);animation:itech-pulse 1.4s ease-in-out infinite;}
.i-dots i:nth-child(2){animation-delay:.25s;} .i-dots i:nth-child(3){animation-delay:.5s;}
/* Tight enough that step two — the tallest — still fits the one screen the
   rest of the page is built to. */
.i-day{border:1px solid var(--border);border-radius:11px;padding:9px 10px;background:var(--surface-3);}
.i-review{border:1px solid var(--border);border-radius:11px;padding:13px;background:var(--surface-3);}
.i-review-done{border:1px solid var(--warn);border-radius:11px;padding:13px;background:var(--warn-soft);}
.i-warn{color:var(--warn);}

.i-layer{height:32px;padding:0 10px;border-radius:999px;border:1px solid var(--border-2);background:transparent;
  color:var(--ink-2);font-family:'IBM Plex Sans Variable','IBM Plex Sans',sans-serif;font-size:12px;font-weight:600;
  cursor:pointer;transition:background-color .15s ease,color .15s ease,border-color .15s ease;}
.i-layer{display:inline-flex;align-items:center;justify-content:center;gap:6px;}
.i-layer:hover{color:var(--ink);}
.i-layer[aria-pressed="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);}

.i-btn-secondary{border-radius:11px;background:transparent;border:1px solid var(--border-2);color:var(--ink);
  font-family:'IBM Plex Sans Variable','IBM Plex Sans',sans-serif;font-weight:600;font-size:13px;cursor:pointer;
  transition:border-color .15s ease,color .15s ease;}
.i-btn-secondary:hover{border-color:var(--accent);color:var(--accent);}
.i-modal-scrim{background:rgba(0,0,0,.5);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);}

.i-well{border:1px solid var(--border);border-radius:14px;background:var(--surface-2);}
.i-layer{background:var(--surface);}

/* Shared platform pages (status, council, admin, auth) — same tokens as the SPA. */
.i-surface-2{background:var(--surface-2);}
.i-surface-3{background:var(--surface-3);}
.i-hairline-2{border-color:var(--border-2);}
.i-bg-accent{background:var(--accent);color:var(--accent-ink);}
.i-divider-bg{background:var(--border);}
.i-danger{color:var(--danger);}

/* The page ground. Replaces the hard-coded `bg-[#0c0a1a] text-white` the auth
   pages carried, which pinned them to dark no matter what the toggle said —
   light mode left white text on a near-black body. Both halves are tokens, so
   the class follows the theme like everything else. */
.i-body{background:var(--solid);color:var(--ink);}

/* ── sign-in card: form controls and the email disclosure ───────────────── */
/* A field on glass. The old markup used bg-slate-50 with a dark: twin, which is
   the pattern that kept coming back white in dark mode; a token surface has one
   definition and follows the theme. */
.i-input{height:40px;padding:0 12px;border-radius:10px;background:var(--surface-3);
  border:1px solid var(--border);color:var(--ink);font-size:13.5px;font-weight:500;
  transition:border-color .15s ease,box-shadow .15s ease;}
.i-input::placeholder{color:var(--ink-3);font-weight:400;}
.i-input:focus{outline:none;border-color:var(--accent-line);box-shadow:0 0 0 3px var(--ring);}
.i-flabel{display:block;margin-bottom:6px;font-size:11px;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;color:var(--ink-2);}
.i-danger-soft{background:var(--danger-soft);border-color:var(--danger);}

/* The credentials disclosure. Full width so its hit area matches the button
   above it, and the chevron turns to show which way it goes. */
.i-disclosure{display:flex;width:100%;align-items:center;justify-content:center;gap:6px;
  height:34px;margin-top:10px;border-radius:9px;background:transparent;border:none;
  color:var(--ink-2);font-size:12.5px;font-weight:600;cursor:pointer;
  transition:color .15s ease,background-color .15s ease;}
.i-disclosure:hover{color:var(--ink);background:var(--surface-3);}
.i-disclosure-chevron{transition:transform .16s ease;}
.i-disclosure[aria-expanded="true"] .i-disclosure-chevron{transform:rotate(180deg);}

/* Secondary action — outlined, so it sits beside a heading without competing
   with the accent-filled primary on the card. */
.i-btn-ghost{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;
  border-radius:9px;background:var(--surface-3);border:1px solid var(--border-2);
  color:var(--ink);font-size:12.5px;font-weight:600;cursor:pointer;
  transition:border-color .15s ease,background-color .15s ease;}
.i-btn-ghost:hover{border-color:var(--accent);background:var(--accent-soft);color:var(--accent);}

/* ── chrome ─────────────────────────────────────────────────────────────── */
/* The top bar. A raised surface with a hairline under it, 60px tall in both
   themes — the prototype's proportion. */
.i-bar{height:60px;background:var(--surface-2);
  -webkit-backdrop-filter:blur(18px) saturate(1.3);backdrop-filter:blur(18px) saturate(1.3);}

/* Square icon button. Every control at this end of the bar is the same 34px
   square, so the right side reads as a set rather than a row of odd chips. */
.i-iconbtn{display:inline-flex;align-items:center;justify-content:center;gap:6px;
  width:34px;height:34px;border-radius:10px;background:var(--surface-3);
  border:1px solid var(--border);color:var(--ink-2);cursor:pointer;text-decoration:none;
  transition:color .15s ease,border-color .15s ease,background-color .15s ease;}
.i-iconbtn:hover{color:var(--ink);border-color:var(--border-2);}

/* The page footer: three parts on one line, quiet. */
.i-foot{border-top:1px solid var(--border);color:var(--ink-3);font-size:11.5px;}
.i-footlink{background:none;border:none;padding:0;cursor:pointer;color:var(--ink-2);
  font-size:11.5px;font-weight:600;text-decoration:none;transition:color .15s ease;}
.i-footlink:hover{color:var(--accent);text-decoration:underline;}

/* Worked example: the arrow between steps, and the roster's people. */
.i-step-arrow{color:var(--ink-3);font-size:13px;line-height:1;}
.i-person{display:flex;align-items:center;gap:8px;margin-top:6px;color:var(--ink);font-size:12.5px;}
.i-avatar{display:grid;place-items:center;width:20px;height:20px;border-radius:999px;
  background:var(--accent-soft);color:var(--accent);font-size:10px;font-weight:700;}
/* One column of days, each laid out as a row — the same data, listed. */
.i-roster-list .i-day{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;}
.i-roster-list .i-person{margin-top:0;}
