/* ============================================================
   Redwood Privacy — Design System
   CSS custom properties, typography, reset, utilities
   ============================================================ */

/* ── Google Fonts ────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

/* ── Color Tokens ────────────────────────────────────────────── */
:root {
  /* Blues */
  --blue-50:  #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  /* Grays */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Semantic: Glossy Steel Theme */
  --bg-void:     #c3d1e4;
  --bg-base:     #cfdeef;
  --bg-surface:  #ffffff;
  --bg-elevated: #f8fafc;
  --bg-hover:    #f1f5f9;
  --bg-glossy-canvas:
    radial-gradient(ellipse 85% 55% at 55% -8%, rgba(255, 255, 255, 0.68) 0%, transparent 62%),
    radial-gradient(ellipse 65% 50% at 92% 18%, rgba(37, 99, 235, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 18% 82%, rgba(59, 130, 246, 0.15) 0%, transparent 62%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(255, 255, 255, 0.28) 0%, transparent 70%),
    linear-gradient(145deg, #cfdeef 0%, #c1d0e5 48%, #b3c5dd 100%);

  --text-primary:   #0b172a;
  --text-secondary: #3b506b;
  --text-muted:     #526884;

  --border-subtle:  #dde5ef;
  --border-default: #c8d5e5;

  /* Blue semantic */
  --blue-border:        rgba(37, 99, 235, 0.18);
  --blue-border-strong: rgba(37, 99, 235, 0.35);

  /* Status */
  --status-safe:     #22c55e;
  --status-warn:     #f59e0b;
  --status-danger:   #ef4444;
  --status-critical: #dc2626;

  /* Shadows — elevated contrast so white cards pop off glossy canvas */
  --shadow-sm:  0 10px 28px -4px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
  --shadow-md:  0 16px 36px -4px rgba(15, 23, 42, 0.16), 0 6px 14px -2px rgba(15, 23, 42, 0.08), inset 0 1px 0 #ffffff;
  --shadow-lg:  0 22px 48px -6px rgba(15, 23, 42, 0.20), 0 8px 20px -4px rgba(15, 23, 42, 0.10), inset 0 1px 0 #ffffff;
  --shadow-glow-blue: 0 0 0 1px rgba(37,99,235,0.22), 0 8px 28px rgba(37,99,235,0.16);

  /* Spacing scale (8px base) */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Typography */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;

  /* Border radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 120ms ease;
  --transition-base: 220ms ease;
  --transition-slow: 380ms ease;

  /* Z-index scale */
  --z-base:    1;
  --z-above:   10;
  --z-nav:     100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-toast:   400;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }


html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-void);
  background-image: var(--bg-glossy-canvas);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  overflow-x: hidden;
}

img, video { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }
ul, ol { list-style: none; }

/* ── Typography ──────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* ── Layout Utilities ────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex            { display: flex; }
.flex-col        { flex-direction: column; }
.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2           { gap: var(--space-2); }
.gap-3           { gap: var(--space-3); }
.gap-4           { gap: var(--space-4); }
.gap-5           { gap: var(--space-5); }
.gap-6           { gap: var(--space-6); }
.flex-1          { flex: 1; }
.w-full          { width: 100%; }
.text-center     { text-align: center; }
.mt-6            { margin-top: var(--space-6); }

/* ── Gradient Text ───────────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(135deg, var(--blue-600) 0%, var(--blue-400) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Glass Card ──────────────────────────────────────────────── */
.card-glass {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.55);
}

/* ── Form Elements ───────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input {
  padding: 10px 14px;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder { color: var(--text-muted); }

.form-error {
  font-size: var(--text-xs);
  color: var(--status-danger);
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  line-height: 1.5;
}

.form-hint { font-size: var(--text-xs); color: var(--text-muted); }

/* ── Password Strength ───────────────────────────────────────── */
.password-strength {
  height: 3px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: var(--space-1);
}

.password-strength-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-base), background var(--transition-base);
  width: 0%;
}

.strength-weak   { width: 20%; background: var(--status-danger); }
.strength-fair   { width: 50%; background: var(--status-warn); }
.strength-good   { width: 75%; background: #84cc16; }
.strength-strong { width: 100%; background: var(--status-safe); }

/* ── Spinner ─────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badges ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.badge-blue    { background: var(--blue-100); color: var(--blue-700); border: 1px solid var(--blue-200); }
.badge-green   { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.2); }
.badge-warning { background: rgba(245,158,11,0.1); color: #92400e; border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: rgba(239,68,68,0.08); color: #991b1b; border: 1px solid rgba(239,68,68,0.15); }
.badge-neutral { background: var(--bg-elevated); color: var(--text-secondary); border: 1px solid var(--border-subtle); }

/* ── Gauge (score ring) ──────────────────────────────────────── */
.gauge-container { position: relative; flex-shrink: 0; }

.gauge-svg { transform: rotate(-90deg); }

.gauge-track {
  fill: none;
  stroke: var(--border-subtle);
  stroke-width: 10;
}

.gauge-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease, stroke 0.4s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.gauge-value  { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em; }
.gauge-label  { font-size: var(--text-xs); color: var(--text-muted); font-weight: 500; }

/* ── Reveal animation ────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
.delay-100 { transition-delay: 0.10s; }
.delay-200 { transition-delay: 0.20s; }
.delay-300 { transition-delay: 0.30s; }
.delay-400 { transition-delay: 0.40s; }
