/* ============================================================
   SafeRide IQ — Shared Stylesheet
   Dark theme with gold accents, matching the iOS app aesthetic.
   ============================================================ */

:root {
  /* Background layers */
  --bg-primary:   #0a0a0c;
  --bg-secondary: #131318;
  --bg-tertiary:  #1c1c24;
  --bg-elevated:  #222230;

  /* Text */
  --text-primary:   #f5f5f7;
  --text-secondary: #c8c8d0;
  --text-tertiary:  #8a8a96;

  /* Accents */
  --gold:        #d4af37;
  --gold-bright: #e8c659;
  --gold-dim:    #8a7126;

  /* Status */
  --danger:  #ff4d4f;
  --success: #34c759;

  /* Borders & dividers */
  --border:        rgba(255, 255, 255, 0.08);
  --border-strong: rgba(212, 175, 55, 0.35);

  /* Geometry */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Type */
  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(212, 175, 55, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(212, 175, 55, 0.04), transparent 70%);
  background-attachment: fixed;
}

/* ---------- Headings ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); margin: 2.2em 0 0.6em; color: var(--gold); }
h3 { font-size: 1.25rem; margin: 1.5em 0 0.4em; color: var(--gold-bright); }

p { margin: 0 0 1em; color: var(--text-secondary); }
strong { color: var(--text-primary); font-weight: 600; }

a {
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease;
}
a:hover { color: #fff; border-bottom-color: var(--gold); }

ul, ol { color: var(--text-secondary); padding-left: 1.4em; }
li { margin: 0.35em 0; }

/* ---------- Header & Nav ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}

nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.9em 1.4em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1em;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  border: none;
  letter-spacing: 0.01em;
}
.logo:hover { color: var(--gold-bright); }

.nav-links {
  list-style: none;
  display: flex;
  gap: 1.6em;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-secondary);
  border: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.3em 0;
  position: relative;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-links a.active { color: var(--gold); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

/* ---------- Main ---------- */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3em 1.4em 4em;
}

section { margin-bottom: 3.5em; }

.updated {
  color: var(--text-tertiary);
  font-size: 0.95em;
  margin-top: -0.5em;
  margin-bottom: 2em;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 3em 1em 2.5em;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.4rem);
  margin: 0.4em 0 0.2em;
  background: linear-gradient(180deg, #fff 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin: 0 0 2em;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 28px;
  background: radial-gradient(circle at 30% 30%, var(--gold-bright), var(--gold) 50%, var(--gold-dim));
  color: #111;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 0 40px rgba(212, 175, 55, 0.35),
    0 20px 50px rgba(0, 0, 0, 0.6);
}

.cta-row {
  display: flex;
  justify-content: center;
  gap: 0.8em;
  flex-wrap: wrap;
  margin-top: 0.5em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); border-bottom: 1px solid transparent; }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #111;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
}
.btn-primary:hover {
  color: #000;
  box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  background: rgba(212, 175, 55, 0.08);
  color: var(--gold-bright);
}

/* ---------- Feature grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2em;
  margin-top: 2em;
}
.feature {
  background: linear-gradient(180deg, var(--bg-secondary), var(--bg-tertiary));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6em 1.4em;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.feature:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}
.feature h3 { margin-top: 0.4em; color: var(--gold-bright); }
.feature p { margin-bottom: 0; font-size: 0.97em; }
.feature-icon {
  display: inline-block;
  font-size: 1.8rem;
  line-height: 1;
}

/* ---------- Cards (used on Support page) ---------- */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5em 1.6em;
  margin: 1em 0;
}
.card h3 { margin-top: 0; }
.card h2 { margin-top: 0; }
.card.danger {
  border-color: rgba(255, 77, 79, 0.4);
  background: linear-gradient(180deg, rgba(255, 77, 79, 0.08), rgba(255, 77, 79, 0.02));
}

/* ---------- Highlight / callout box ---------- */
.highlight {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(212, 175, 55, 0.02));
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1.3em 1.5em;
  margin: 1.5em 0;
}
.highlight strong { color: var(--gold-bright); }
.highlight ul { margin: 0.6em 0 0; }

/* ---------- Tables (CCPA section in privacy policy) ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92em;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
th, td {
  text-align: left;
  padding: 0.7em 0.9em;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-tertiary);
  color: var(--gold);
  font-weight: 600;
  font-size: 0.88em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:last-child td { border-bottom: none; }
td { color: var(--text-secondary); }

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  text-align: center;
  padding: 2.5em 1.4em 3em;
  color: var(--text-tertiary);
  font-size: 0.92em;
}
footer a {
  color: var(--text-secondary);
  border: none;
  margin: 0 0.2em;
}
footer a:hover { color: var(--gold); }

.disclaimer-footer {
  max-width: 700px;
  margin: 1.5em auto 0;
  font-size: 0.82em;
  line-height: 1.55;
  color: var(--text-tertiary);
  font-style: italic;
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  nav { padding: 0.8em 1em; }
  .nav-links { gap: 1em; }
  .nav-links a { font-size: 0.9rem; }
  main { padding: 2em 1.1em 3em; }
  .hero { padding: 2em 0.5em 1.5em; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; text-align: center; }
  table { font-size: 0.82em; }
  th, td { padding: 0.55em 0.6em; }
}

/* ---------- Focus visibility (accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
