/* ============================================================================
   SHARED DESIGN TOKENS — static HTML pages (Survey Hub, Reports Hub, Photo
   Album Studio, Survey Capture). Link this file, then use var(--token)
   everywhere instead of hardcoded colors — that's what makes light/dark
   mode and any future palette change apply consistently across every
   page at once. Mirrors react-app/src/styles/design-tokens.css so the
   whole product (React + static pages) shares one visual language.
   ============================================================================ */

:root, [data-theme="dark"] {
  --bg: #06101d;
  --surface: #0b1728;
  --card: #0f1d33;
  --card-hover: #14253f;
  --border: rgba(158, 178, 210, 0.12);
  --border-strong: rgba(158, 178, 210, 0.22);
  --overlay: rgba(3, 8, 16, 0.74);

  --primary: #5b8cff;
  --primary-hover: #7aa0ff;
  --primary-contrast: #06122b;
  --gold: #e9b949;                    /* brand gold — the tick in the mark */
  --gold-soft: rgba(233, 185, 73, 0.14);
  --gold-line: rgba(233, 185, 73, 0.55);
  --secondary: #35d0bb;
  --secondary-hover: #5fdcca;
  --accent: #8fb3ff;
  --success: #2fc98f;
  --success-bg: rgba(47, 201, 143, 0.14);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.14);
  --danger: #ff5a6a;
  --danger-bg: rgba(255, 90, 106, 0.14);

  --text-primary: #f1f4f9;
  --text-secondary: #9eabc0;
  --text-muted: #6f7d93;
  --text-on-primary: #06122b;

  --hover: rgba(158, 178, 210, 0.07);
  --active: rgba(91, 140, 255, 0.16);
  --focus-ring: rgba(91, 140, 255, 0.5);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 32px 80px rgba(0, 0, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-full: 999px;

  --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;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Sora', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --text-xs: clamp(10.5px, 0.9vw, 11.5px);
  --text-sm: clamp(12px, 1vw, 13px);
  --text-base: clamp(13.5px, 1.1vw, 14.5px);
  --text-lg: clamp(15px, 1.4vw, 17px);
  --text-xl: clamp(18px, 2vw, 22px);
  --text-2xl: clamp(22px, 3vw, 28px);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
  /* Premium white + royal-blue SaaS palette (the default) */
  --bg: #f4f7fc;
  --surface: #ffffff;
  --card: #ffffff;
  --card-hover: #f6f9fe;
  --border: #e4e9f2;
  --border-strong: #cdd6e6;
  --overlay: rgba(15, 28, 54, 0.45);

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-contrast: #ffffff;
  --gold: #b7791f;
  --gold-soft: rgba(183, 121, 31, 0.12);
  --gold-line: rgba(183, 121, 31, 0.5);
  --secondary: #1e40af;
  --secondary-hover: #1a3798;
  --accent: #3b82f6;
  --success: #0f8a5f;
  --success-bg: rgba(15, 138, 95, 0.1);
  --warning: #b45309;
  --warning-bg: rgba(180, 83, 9, 0.1);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.1);

  --text-primary: #0b1b33;
  --text-secondary: #46566f;
  --text-muted: #8893a6;
  --text-on-primary: #ffffff;

  --hover: rgba(37, 99, 235, 0.045);
  --active: rgba(37, 99, 235, 0.12);
  --focus-ring: rgba(37, 99, 235, 0.45);

  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.1);
  --shadow-xl: 0 32px 80px rgba(15, 23, 42, 0.14);
}

* { transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease); }

.ds-btn {
  font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 600;
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
  cursor: pointer; transition: transform 0.15s var(--ease), background 0.2s, border-color 0.2s; min-height: 44px;
}
.ds-btn:hover { background: var(--hover); transform: translateY(-1px); }
.ds-btn-primary { background: var(--primary); border-color: var(--primary); color: var(--text-on-primary); }
.ds-btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); }

.ds-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.3px;
}
.ds-badge-success { background: var(--success-bg); color: var(--success); }
.ds-badge-warning { background: var(--warning-bg); color: var(--warning); }
.ds-badge-danger { background: var(--danger-bg); color: var(--danger); }

.ds-theme-toggle {
  width: 38px; height: 38px; border-radius: 50%; background: var(--hover); border: 1px solid var(--border-strong); color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s;
}
.ds-theme-toggle:hover { transform: translateY(-2px) rotate(15deg); background: var(--active); }

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-track { background: transparent; }

/** tiny helper every page's inline script can call:
 *  toggleAppTheme() flips data-theme on <html> and remembers the choice. */
