/* MachineSafe Compliance Suite — shared design system.
   Loaded by EVERY page (marketing, account and tools).

   Light + dark are driven by [data-theme] on <html>, set before first paint by
   theme.js. Dark values only apply on screen, so printed reports are always light.
   Brand: safety-yellow on graphite/white, soft glass surfaces, rounded geometry. */

:root {
  color-scheme: light;

  /* surfaces */
  --bg0: #f4f5fa;
  --bg1: #eceef6;
  --bg2: #f8f9fc;
  --surface: #ffffff;
  --surface-2: #f3f4f9;
  --surface-3: #e8ebf4;
  --field-bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;
  --panel2: #ffffff;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.9);

  /* lines */
  --border: rgba(18, 22, 45, 0.09);
  --border-soft: rgba(18, 22, 45, 0.16);
  --border-strong: rgba(18, 22, 45, 0.3);
  --grid-line: rgba(18, 22, 45, 0.045);

  /* text */
  --text: #484f68;
  --heading: #0d1020;
  --muted: #6a7188;
  --muted2: #484f68;
  --ink: #0d1020;
  --on-signal: #17120a;

  /* brand + accents */
  --signal: #ffc21a;
  --signal-2: #ff8f1f;
  --signal-soft: rgba(255, 194, 26, 0.18);
  --accent: #9a5b00;
  --accent-deep: #7a4600;
  --accent2: #3452d9;
  --link: #3047c9;
  --g1: #d98a00;
  --g2: #e8501f;

  /* status */
  --success: #138a43;
  --success-soft: #138a43;
  --success-bg: rgba(19, 138, 67, 0.12);
  --amber: #9a5b00;
  --warn: #b26b00;
  --warn-bg: rgba(255, 194, 26, 0.2);
  --danger: #c62d2d;
  --danger-bg: rgba(198, 45, 45, 0.1);
  --info: #2563eb;
  --info-bg: rgba(37, 99, 235, 0.1);

  /* risk levels */
  --r-low-bg: #dcf5e4;
  --r-low-fg: #14602f;
  --r-med-bg: #fdf0c4;
  --r-med-fg: #7c4a03;
  --r-high-bg: #fddcdc;
  --r-high-fg: #8e1f1f;
  --r-vh-bg: #8e1f1f;
  --r-vh-fg: #ffffff;

  /* geometry + depth */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 50, 0.06), 0 2px 8px rgba(20, 24, 50, 0.05);
  --shadow: 0 10px 30px -8px rgba(20, 24, 50, 0.16), 0 2px 6px rgba(20, 24, 50, 0.05);
  --shadow-lg: 0 30px 70px -20px rgba(20, 24, 50, 0.28), 0 8px 20px -8px rgba(20, 24, 50, 0.12);
  --glow: 0 10px 30px -6px rgba(255, 170, 20, 0.55);
  --focus-ring: 0 0 0 3px rgba(255, 194, 26, 0.5);

  /* background atmosphere */
  --blob-a: rgba(255, 194, 26, 0.42);
  --blob-b: rgba(80, 110, 255, 0.22);
  --blob-c: rgba(255, 110, 90, 0.2);
  --cursor-glow: rgba(255, 190, 30, 0.16);

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 0.18s;
  --dur: 0.35s;
  --dur-slow: 0.8s;

  /* type */
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

@media screen {
  :root[data-theme='dark'] {
    color-scheme: dark;

    --bg0: #090b11;
    --bg1: #0d1018;
    --bg2: #11141d;
    --surface: #131722;
    --surface-2: #181d2a;
    --surface-3: #202636;
    --field-bg: #0c0f17;
    --panel: rgba(21, 25, 37, 0.72);
    --panel-solid: #131722;
    --panel2: #131722;
    --glass: rgba(17, 20, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);

    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.15);
    --border-strong: rgba(255, 255, 255, 0.3);
    --grid-line: rgba(255, 255, 255, 0.045);

    --text: #aab2c8;
    --heading: #f5f7fc;
    --muted: #8189a1;
    --muted2: #b4bbd0;
    --ink: #f5f7fc;

    --signal: #ffc21a;
    --signal-2: #ff9a2e;
    --signal-soft: rgba(255, 194, 26, 0.14);
    --accent: #ffd04d;
    --accent-deep: #ffe08a;
    --accent2: #7c93ff;
    --link: #8fa2ff;
    --g1: #ffcf40;
    --g2: #ff7a45;

    --success: #4ade80;
    --success-soft: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.13);
    --amber: #ffd04d;
    --warn: #ffd04d;
    --warn-bg: rgba(255, 194, 26, 0.14);
    --danger: #ff7b7b;
    --danger-bg: rgba(255, 90, 90, 0.14);
    --info: #7cb1ff;
    --info-bg: rgba(90, 150, 255, 0.15);

    --r-low-bg: rgba(74, 222, 128, 0.15);
    --r-low-fg: #86efac;
    --r-med-bg: rgba(255, 194, 26, 0.16);
    --r-med-fg: #fcd34d;
    --r-high-bg: rgba(255, 100, 100, 0.17);
    --r-high-fg: #fca5a5;
    --r-vh-bg: #dc2626;
    --r-vh-fg: #ffffff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.65), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 34px 80px -20px rgba(0, 0, 0, 0.8), 0 8px 24px -8px rgba(0, 0, 0, 0.5);
    --glow: 0 10px 34px -6px rgba(255, 170, 20, 0.4);
    --focus-ring: 0 0 0 3px rgba(255, 194, 26, 0.4);

    --blob-a: rgba(255, 194, 26, 0.17);
    --blob-b: rgba(80, 110, 255, 0.25);
    --blob-c: rgba(255, 90, 120, 0.14);
    --cursor-glow: rgba(255, 190, 30, 0.1);
  }
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; interpolate-size: allow-keywords; scroll-padding-top: 88px; }
body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
a { color: var(--link); text-underline-offset: 3px; }
::selection { background: var(--signal); color: var(--on-signal); }
:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.hidden { display: none !important; }
img, svg { max-width: 100%; }

/* ---------- Cross-page + theme-switch transitions ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 0.22s ease both; }
  ::view-transition-new(root) { animation: vt-in 0.4s var(--ease) both; }
  .theme-vt::view-transition-old(root),
  .theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  .theme-vt::view-transition-old(root) { z-index: 1; }
  .theme-vt::view-transition-new(root) { z-index: 2; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Atmosphere: drifting colour blobs + blueprint grid ---------- */
.bg-aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: var(--bg0); transition: background-color 0.4s var(--ease); }
.bg-aurora .blob { position: absolute; border-radius: 50%; filter: blur(70px); will-change: transform; }
.bg-aurora .b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: var(--blob-a); animation: drift-a 26s ease-in-out infinite alternate; }
.bg-aurora .b2 { width: 40vmax; height: 40vmax; right: -14vmax; top: 6vmax; background: var(--blob-b); animation: drift-b 32s ease-in-out infinite alternate; }
.bg-aurora .b3 { width: 34vmax; height: 34vmax; left: 28vmax; bottom: -18vmax; background: var(--blob-c); animation: drift-c 38s ease-in-out infinite alternate; }
.bg-aurora .grid-overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 0, transparent 75%);
  animation: grid-pan 40s linear infinite;
}
.bg-aurora .grain { position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: overlay; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E"); }
.cursor-glow {
  position: fixed; left: 0; top: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, var(--cursor-glow), transparent); opacity: 0; transition: opacity 0.6s ease; will-change: transform;
}
.cursor-glow.on { opacity: 1; }
@keyframes drift-a { to { transform: translate(14vmax, 10vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vmax, 14vmax) scale(0.9); } }
@keyframes drift-c { to { transform: translate(-16vmax, -8vmax) scale(1.2); } }
@keyframes grid-pan { to { background-position: 56px 56px; } }

.scroll-progress { position: fixed; left: 0; top: 0; right: 0; height: 3px; z-index: 120; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--signal), var(--signal-2)); pointer-events: none; }

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur) var(--ease), background-color 0.4s var(--ease);
}
.site-nav.is-scrolled { box-shadow: 0 8px 30px -12px rgba(10, 14, 35, 0.28); }
.site-nav-inner { max-width: 1180px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 28px; transition: padding var(--dur) var(--ease); }
.site-nav.is-scrolled .site-nav-inner { padding-top: 9px; padding-bottom: 9px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex-shrink: 0; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--signal), var(--signal-2));
  color: var(--on-signal); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95em; padding-top: 9px;
  clip-path: polygon(50% 2%, 98% 96%, 2% 96%);
  transition: transform 0.5s var(--ease-spring);
}
.brand-mark::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.75) 50%, transparent 65%); transform: translateX(-120%); animation: brand-shine 6s ease-in-out 1.5s infinite; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.1); }
@keyframes brand-shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.brand-name { color: var(--heading); font-weight: 700; font-size: 1.05em; line-height: 1.1; letter-spacing: -0.01em; }
.brand-name small { display: block; font-family: var(--font-mono); font-weight: 500; color: var(--muted); font-size: 0.58em; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 3px; }
.nav-links { display: flex; gap: 6px; margin-left: 8px; }
.nav-links a {
  position: relative; color: var(--muted2); text-decoration: none; font-size: 0.88em; font-weight: 500;
  padding: 8px 14px; border-radius: var(--radius-pill); transition: color var(--dur-fast), background var(--dur-fast);
}
.nav-links a::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; border-radius: 2px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform var(--dur) var(--ease); }
.nav-links a:hover { color: var(--heading); background: var(--signal-soft); }
.nav-links a:hover::after, .nav-links a[aria-current='page']::after { transform: scaleX(1); }
.nav-links a[aria-current='page'] { color: var(--heading); }
.nav-actions { margin-left: auto; display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.nav-links, .auth-row { white-space: nowrap; }

/* theme toggle */
.theme-toggle {
  position: relative; width: 40px; height: 40px; flex-shrink: 0; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border-soft); background: var(--surface); color: var(--heading); cursor: pointer;
  transition: transform var(--dur) var(--ease-spring), border-color var(--dur-fast), background var(--dur-fast);
}
.theme-toggle:hover { transform: rotate(18deg) scale(1.08); border-color: var(--signal); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle svg { position: absolute; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.6s var(--ease-spring), opacity 0.3s; }
.theme-toggle .i-sun { transform: rotate(0) scale(1); opacity: 1; }
.theme-toggle .i-moon { transform: rotate(-90deg) scale(0.3); opacity: 0; }
:root[data-theme='dark'] .theme-toggle .i-sun { transform: rotate(90deg) scale(0.3); opacity: 0; }
:root[data-theme='dark'] .theme-toggle .i-moon { transform: rotate(0) scale(1); opacity: 1; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  padding: 0.85em 1.5em; border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft); background: var(--surface); color: var(--heading);
  font-family: var(--font); font-weight: 600; font-size: 0.9rem; line-height: 1.1; letter-spacing: -0.005em; text-decoration: none; white-space: nowrap;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease), translate 0.3s var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), filter var(--dur-fast);
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-sm); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; filter: saturate(0.6); }
.btn-sm, .btn-small { padding: 0.62em 1.1em; font-size: 0.8rem; }
.btn-lg { padding: 1.05em 1.9em; font-size: 0.98rem; }
.btn-block { width: 100%; }
.btn .ripple { position: absolute; border-radius: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; background: currentColor; opacity: 0.28; transform: scale(0); animation: ripple 0.65s var(--ease) forwards; pointer-events: none; z-index: -1; }
@keyframes ripple { to { transform: scale(46); opacity: 0; } }

.btn-primary { background: linear-gradient(135deg, var(--signal), var(--signal-2)); border-color: transparent; color: var(--on-signal); box-shadow: var(--glow); }
.btn-primary::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%); transform: translateX(-130%); transition: transform 0.7s var(--ease); }
.btn-primary:hover { border-color: transparent; box-shadow: 0 16px 38px -8px rgba(255, 150, 20, 0.7); }
.btn-primary:hover::before { transform: translateX(130%); }
.btn-secondary { background: var(--surface-2); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--signal-soft); box-shadow: none; }
.btn-accent { background: transparent; border-color: var(--accent); color: var(--accent); box-shadow: none; }
.btn-accent:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn-success { background: linear-gradient(135deg, #17a34a, #22c55e); border-color: transparent; color: #04200f; }
.btn-info { background: linear-gradient(135deg, #2f6df0, #4f9bff); border-color: transparent; color: #fff; }
.btn-warning { background: linear-gradient(135deg, #ffc21a, #ffd75e); border-color: transparent; color: #2a1d00; }
.btn-danger { background: linear-gradient(135deg, #dc2626, #f0603a); border-color: transparent; color: #fff; }
.btn-success:hover, .btn-info:hover, .btn-warning:hover, .btn-danger:hover { border-color: transparent; filter: brightness(1.08); }

.btn-auth-login, .btn-auth-register {
  padding: 0.6em 1.15em; font-family: var(--font); font-size: 0.82rem; font-weight: 600; border-radius: var(--radius-pill); cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast), box-shadow var(--dur);
}
.btn-auth-login { background: transparent; border: 1px solid var(--border-soft); color: var(--heading); }
.btn-auth-login:hover { border-color: var(--heading); transform: translateY(-1px); }
.btn-auth-register { background: var(--ink); border: 1px solid var(--ink); color: var(--bg0); }
.btn-auth-register:hover { background: var(--signal); border-color: var(--signal); color: var(--on-signal); transform: translateY(-1px); box-shadow: var(--glow); }
.btn-auth-login:active, .btn-auth-register:active { transform: scale(0.96); }
.auth-email { font-family: var(--font-mono); color: var(--heading); border: 1px solid var(--border-soft); background: var(--surface); padding: 7px 14px; border-radius: var(--radius-pill); font-size: 0.74rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button-group { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- Form controls (zero specificity so components can refine) ---------- */
:where(input[type='text'], input[type='email'], input[type='password'], input[type='date'], input[type='number'], input[type='search'], input[type='url'], input[type='tel'], select, textarea) {
  padding: 0.75em 0.95em; background: var(--field-bg); color: var(--heading);
  border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  font: inherit; font-size: 0.95rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background var(--dur-fast);
}
:where(input, select, textarea):where(:hover) { border-color: var(--border-strong); }
:where(input, select, textarea):where(:focus) { outline: none; border-color: var(--signal); box-shadow: var(--focus-ring); }
:where(input, textarea)::placeholder { color: var(--muted); opacity: 0.8; }
:where(input[type='checkbox'], input[type='radio']) { accent-color: var(--signal); width: 1.05em; height: 1.05em; cursor: pointer; }
:where(select) { cursor: pointer; }
:where(textarea) { resize: vertical; }

.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 8px; color: var(--heading); }
.form-group input[type='text'], .form-group input[type='date'], .form-group input[type='email'], .form-group input[type='number'], .form-group textarea, .form-group select { width: 100%; }
.checkbox-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
.checkbox-group label, .hazard-list label { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 0.92rem; color: var(--text); cursor: pointer; margin: 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color var(--dur-fast), background var(--dur-fast), transform var(--dur-fast) var(--ease); }
.checkbox-group label:hover, .hazard-list label:hover { border-color: var(--signal); background: var(--signal-soft); transform: translateY(-1px); }
.checkbox-group input[type='checkbox'], .hazard-list input { margin: 0; }

.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 600; margin-bottom: 7px; font-size: 0.82rem; color: var(--heading); }
.auth-field input { width: 100%; }
.auth-error { color: var(--danger); font-size: 0.88rem; margin: 0 0 12px; }
.auth-info { color: var(--muted2); font-size: 0.88rem; margin: 0 0 12px; }
.auth-switch { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.auth-switch a { font-weight: 600; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 10, 22, 0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: modal-bg 0.3s ease both; }
.modal.hidden { display: none !important; }
.modal-content {
  position: relative; width: 100%; max-width: 700px; max-height: 90vh; overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  animation: modal-pop 0.5s var(--ease-spring) both;
}
.modal-content::before { content: ''; position: sticky; top: 0; z-index: 2; display: block; height: 4px; background: linear-gradient(90deg, var(--signal), var(--signal-2)); }
.modal-content.modal-lg { max-width: 900px; }
.modal-content.modal-sm, #authModal .modal-content { max-width: 440px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 26px; border-bottom: 1px solid var(--border); color: var(--heading); }
.modal-header h2 { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.015em; color: var(--heading); }
.modal-close { width: 38px; height: 38px; display: grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 50%; font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; transition: transform var(--dur) var(--ease-spring), background var(--dur-fast), color var(--dur-fast); }
.modal-close:hover { background: var(--surface-3); color: var(--heading); transform: rotate(90deg); }
.modal-body { padding: 24px 26px; }
.modal-footer { display: flex; flex-direction: column; gap: 10px; padding: 18px 26px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-footer > div { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-footer .btn { margin: 0; }
.modal-footer-note { font-size: 0.86rem; color: var(--accent); background: var(--signal-soft); border-radius: var(--radius-sm); padding: 9px 14px; text-align: center; }
@keyframes modal-bg { from { opacity: 0; } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(26px) scale(0.94); } }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2000; background: var(--ink); color: var(--bg0); padding: 13px 24px; border-radius: var(--radius-pill); font-size: 0.88rem; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in 0.5s var(--ease-spring) both; max-width: calc(100vw - 32px); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 24px) scale(0.9); } }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js .reveal { opacity: 0; translate: 0 26px; scale: 0.985; transition: opacity 0.9s var(--ease), translate 0.9s var(--ease), scale 0.9s var(--ease); transition-delay: var(--reveal-delay, 0ms); }
.js .reveal.visible { opacity: 1; translate: 0 0; scale: 1; }

/* ---------- Pointer-tracked spotlight (set via motion.js: --mx / --my) ---------- */
[data-spotlight] { position: relative; isolation: isolate; }
[data-spotlight]::before { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 0.35s ease; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--signal-soft), transparent 60%); z-index: -1; }
[data-spotlight]:hover::before { opacity: 1; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; translate: none; scale: 1; }
  .bg-aurora .blob, .cursor-glow { display: none; }
}

@media print {
  .bg-aurora, .cursor-glow, .scroll-progress, .theme-toggle, .site-nav, .toast { display: none !important; }
  body { background: #fff; color: #000; }
}

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: 0.82rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border, rgba(128,128,128,0.3)); }
.btn-google { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #3c4043; border: 1px solid #dadce0; font-weight: 600; }
.btn-google:hover { background: #f7f8f8; }
#authResendWrap a { font-weight: 600; }
