/* ────────────────────────────────────────────────────────────────────────────
   Freedive Finder — Global Stylesheet
   Design tokens, reset styles, and shared component classes
   ──────────────────────────────────────────────────────────────────────────── */

/* ── Design Tokens (CSS Custom Properties) ────────────────────────────────── */
:root {
  /* Colors */
  --navy: #013a54;
  --surface: #023e52;
  --deep: #012a37;
  --teal: #078a99;
  --teal-lt: #4cb8c6;
  --coral: #ee6c4d;
  --white: #ffffff;
  --white-70: rgba(255, 255, 255, 0.7);
  --white-50: rgba(255, 255, 255, 0.5);
  --white-20: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  --line-height-tight: 1.2;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 100px;

  /* Layout */
  --content-max-width: 1000px;
  --content-narrow-width: 680px;
  --nav-height: 64px;
  /* Top padding for hero sections — nav height plus visual breathing room. */
  --hero-padding-top: 120px;

  /* Border Radius */
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;

  /* Transitions */
  --transition-fast: 0.15s;
  --transition-normal: 0.2s;
}

/* ── Reset & Base Styles ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* Offset anchor-link scroll targets so content isn't hidden behind the fixed nav. */
  scroll-padding-top: calc(var(--nav-height) + var(--space-md));
  /* Match the footer's apparent colour so overscroll (rubber-band on macOS)
     blends with the footer instead of revealing a seam. Derived from
     rgba(1, 42, 55, 0.5) composited over var(--navy) #013a54. */
  background-color: #013246;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-family);
  background-color: var(--navy);
  background-image: radial-gradient(
    ellipse at 50% 0%,
    rgba(7, 138, 153, 0.25) 0%,
    transparent 60%
  );
  background-attachment: fixed;
  color: var(--white);
  line-height: var(--line-height-base);
  font-size: var(--font-size-base);
  /* Flex column pushes the footer to the bottom without overflow */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Smooth transitions for reduced motion users */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Focus Styles (Accessibility) ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
  background-color: rgba(7, 138, 153, 0.1);
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Horizontal padding matches var(--space-md) so the nav edges line up
     with the admin panel's full-width Flutter content. A larger inset
     on marketing pages would drift out of sync when switching between
     surfaces; keeping the rule global prevents that. */
  padding: 16px var(--space-md);
  background: rgba(1, 42, 55, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--white-20);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  transition: color var(--transition-normal);
}

.nav-brand:hover {
  color: var(--teal-lt);
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
}

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  color: var(--white-70);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-normal);
}

.nav-links a:hover {
  color: var(--white);
}

.nav-links a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  color: var(--white);
}

/* Hamburger menu toggle button (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 8px;
  margin-right: -8px; /* Offset for touch target */
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--teal);
  color: var(--white);
  padding: 14px 32px;
  border-radius: var(--border-radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition:
    background var(--transition-normal),
    transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--teal-lt);
  transform: translateY(-1px);
}

.btn-primary:focus-visible {
  background: var(--teal-lt);
  transform: translateY(-1px);
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--white-20);
  color: var(--white);
  padding: 14px 32px;
  border-radius: var(--border-radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition:
    background var(--transition-normal),
    transform var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn-secondary:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
  outline: 2px solid var(--teal-lt);
  outline-offset: 3px;
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--white-20);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  transition:
    border-color var(--transition-normal),
    transform var(--transition-normal);
}

.card:hover {
  border-color: rgba(7, 138, 153, 0.5);
  transform: translateY(-2px);
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  background: var(--white-20);
  border: 1px solid rgba(76, 184, 198, 0.4);
  color: var(--teal-lt);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: var(--line-height-tight);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(24px, 5vw, 42px);
  font-weight: 800;
  line-height: var(--line-height-tight);
  margin-bottom: 12px;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
}

strong {
  font-weight: 600;
}

em {
  font-style: italic;
}

a {
  color: var(--teal-lt);
  text-decoration: none;
  transition: text-decoration var(--transition-normal);
}

a:hover {
  text-decoration: underline;
}

/* ── Section Labels & Headings ────────────────────────────────────────────── */
.section-label {
  text-align: center;
  color: var(--teal-lt);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-title {
  text-align: center;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
}

.section-sub {
  text-align: center;
  color: var(--white-70);
  font-size: 16px;
  max-width: 500px;
  margin: 0 auto 64px;
}

/* ── Containers & Layouts ─────────────────────────────────────────────────── */
.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container--narrow {
  max-width: var(--content-narrow-width);
}

main {
  flex: 1;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.form-field label {
  font-weight: 600;
  margin-bottom: 8px;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 12px 16px;
  border: 1px solid var(--white-20);
  border-radius: var(--border-radius-md);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  font-family: var(--font-family);
  font-size: 16px;
  transition: border-color var(--transition-normal);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  background: rgba(255, 255, 255, 0.08);
}

.form-field input::placeholder {
  color: var(--white-50);
}

.form-error {
  color: var(--coral);
  font-size: 14px;
  margin-top: 4px;
}

/* ── Alerts & Messages ────────────────────────────────────────────────────── */
.alert {
  padding: 16px 20px;
  border-radius: var(--border-radius-md);
  margin-bottom: 16px;
  background: rgba(7, 138, 153, 0.1);
  border: 1px solid rgba(76, 184, 198, 0.3);
  color: var(--white-70);
}

.alert--warning {
  background: rgba(238, 108, 77, 0.1);
  border-color: rgba(238, 108, 77, 0.3);
  color: #ffaa88;
}

.alert--success {
  background: rgba(76, 184, 198, 0.1);
  border-color: rgba(76, 184, 198, 0.3);
  color: var(--teal-lt);
}

/* ── Disclaimer Boxes ─────────────────────────────────────────────────────── */
.disclaimer {
  background: rgba(238, 108, 77, 0.1);
  border: 1px solid rgba(238, 108, 77, 0.3);
  border-radius: var(--border-radius-md);
  padding: 16px 20px;
  font-size: 13px;
  color: var(--white-70);
  font-style: italic;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* ── Summary Box (legal documents, callouts) ───────────────────────────────── */
.summary-box {
  background: rgba(7, 138, 153, 0.1);
  border: 1px solid rgba(76, 184, 198, 0.3);
  border-radius: var(--border-radius-md);
  padding: var(--space-lg);
  margin-bottom: 40px;
}

.summary-box h2 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--teal-lt);
}

.summary-box p {
  color: var(--white-70);
  font-size: 15px;
  margin-bottom: 12px;
}

.summary-box p:last-child {
  margin-bottom: 0;
}

.summary-box ul {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}

.summary-box li {
  color: var(--white-70);
  font-size: 15px;
  padding-left: 20px;
  position: relative;
  margin-bottom: 6px;
}

.summary-box li::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--teal-lt);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.4;
}

.summary-box--check li::before {
  content: "✓";
  left: 0;
  font-size: inherit;
  line-height: inherit;
}

.summary-box strong {
  color: var(--white);
}

/* ── Store Badges ─────────────────────────────────────────────────────────── */
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--white-20);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 28px;
  border-radius: var(--border-radius-md);
  text-decoration: none;
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  transition:
    background var(--transition-normal),
    transform var(--transition-fast);
}

.store-badge:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.store-badge svg {
  width: 24px;
  height: 24px;
  fill: var(--white);
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer {
  background: rgba(1, 42, 55, 0.5);
  border-top: 1px solid var(--white-20);
  padding: 40px 24px;
  text-align: center;
}

footer p {
  color: var(--white-70);
  font-size: 14px;
  margin-bottom: 0;
}

footer a {
  color: var(--teal-lt);
}

footer a:hover {
  text-decoration: underline;
}

.footer-links {
  display: inline;
}

.footer-links a {
  font-size: 14px;
}

/* ── Utility Classes ──────────────────────────────────────────────────────── */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--white-70);
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mt-lg {
  margin-top: var(--space-lg);
}

.mt-xl {
  margin-top: var(--space-xl);
}

.mb-sm {
  margin-bottom: var(--space-sm);
}

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.mb-xl {
  margin-bottom: var(--space-xl);
}

.hidden-mobile {
  display: block;
}

.hidden-desktop {
  display: none;
}

/* ── Responsive Design ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  nav {
    padding: 14px 20px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    display: none;
    background: rgba(1, 42, 55, 0.95);
    border-bottom: 1px solid var(--white-20);
    padding: 16px 0;
    backdrop-filter: blur(12px);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid var(--white-20);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }

  .hidden-mobile {
    display: none;
  }

  .hidden-desktop {
    display: block;
  }
}

/* ── Print Styles ─────────────────────────────────────────────────────────── */
@media print {
  nav,
  footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    color: blue;
  }
}
