/* Pilot Planner legal and support pages, using the Coetic X design system and
   the product's established navy and green identity. */

:root {
  color-scheme: light;
  --header-height: 73px;

  /* Surfaces — Coetic X */
  --deep: #0f2733;
  --deep-2: #13293c;
  --light: #f4fbfb;
  --light-alt: #e6f1f0;
  --white: #ffffff;

  /* Pilot Planner product identity */
  --product-bg: #242b56;
  --product-bg-deep: #1a2044;
  --accent: #55bd8c;
  --accent-strong: #2f8f8a;
  --accent-soft: rgba(85, 189, 140, 0.16);

  /* Text — flipped per section by .on-light */
  --ink: #eef7f6;
  --muted: #c2d4d6;
  --ink-dark: #0d1d22;
  --muted-dark: #4e5c5f;

  --border: rgba(255, 255, 255, 0.16);
  --border-light: #d5e2e0;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --pill: 999px;

  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --shadow-light: 0 24px 60px rgba(15, 29, 29, 0.12);

  --shell: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
  background: var(--deep);
}

body {
  margin: 0;
  -webkit-tap-highlight-color: rgba(85, 189, 140, 0.16);
  padding-top: var(--header-height);
  overflow-x: hidden;
  background: var(--deep);
  color: var(--ink-dark);
  font-family: -apple-system, BlinkMacSystemFont, "Avenir Next", "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

/* Focus: dark ring on light surfaces, accent ring on dark ones. */
a:focus-visible {
  border-radius: var(--radius-sm);
  outline: 3px solid #146046;
  outline-offset: 4px;
}

.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline-color: #7fe0ae;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--pill);
  background: var(--light);
  color: var(--ink-dark);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(var(--shell), calc(100% - 48px));
  margin-inline: auto;
  padding-inline: max(0px, env(safe-area-inset-left) - 8px)
    max(0px, env(safe-area-inset-right) - 8px);
}

/* ---------------------------------------------------------------- typography */

h1,
h2,
h3 {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.6rem, 4.2vw, 3.9rem);
  font-weight: 750;
  letter-spacing: -0.021em;
}

h2 {
  font-size: clamp(1.9rem, 2.9vw, 2.7rem);
  font-weight: 740;
  letter-spacing: -0.018em;
}

h3 {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.008em;
}

p {
  text-wrap: pretty;
}

/* The Coetic X eyebrow: small, light, widely tracked, muted — never shouted. */
.eyebrow {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.on-light .eyebrow {
  color: var(--accent-strong);
}

/* ------------------------------------------------------------------- header */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--header-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(10, 24, 34, 0.62);
  color: var(--ink);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.product-brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--pill);
  color: rgba(238, 247, 246, 0.72);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

/* Navigation underline that wipes in from the left. */
.site-nav a::after {
  position: absolute;
  right: 16px;
  bottom: 8px;
  left: 16px;
  height: 2px;
  border-radius: var(--pill);
  background: linear-gradient(90deg, rgba(85, 189, 140, 0.9), rgba(47, 143, 138, 0.3));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s var(--ease);
  content: "";
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a:hover::after {
  transform: scaleX(1);
}

.site-footer {
  background: var(--deep);
  color: var(--ink);
}
.footer-bottom {
  min-height: 108px;
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px 36px;
  padding-block: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-identity {
  display: grid;
  gap: 5px;
}

.footer-brand {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.footer-attribution {
  margin: 0;
  color: rgba(238, 247, 246, 0.44);
  font-size: 0.75rem;
}

.footer-attribution a {
  display: inline-block;
  padding-block: 6px;
  color: rgba(238, 247, 246, 0.72);
  text-decoration: underline;
  text-decoration-color: rgba(238, 247, 246, 0.24);
  text-underline-offset: 3px;
  transition: color 0.2s var(--ease), text-decoration-color 0.2s var(--ease);
}

.footer-attribution a:hover {
  color: var(--ink);
  text-decoration-color: rgba(238, 247, 246, 0.7);
}

.footer-bottom nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 10px;
}

.footer-bottom nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding-inline: 12px;
  border-radius: var(--pill);
  color: rgba(238, 247, 246, 0.6);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.footer-bottom nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

.footer-copyright {
  justify-self: end;
  margin: 0;
  color: rgba(238, 247, 246, 0.38);
  font-size: 0.75rem;
}

.legal-header {
  position: relative;
  padding-block: clamp(48px, 6vw, 76px) clamp(40px, 5vw, 60px);
  background: radial-gradient(circle at 12% 20%, rgba(47, 143, 138, 0.3), transparent 56%),
    radial-gradient(circle at 88% 90%, rgba(36, 43, 86, 0.55), transparent 58%),
    linear-gradient(158deg, var(--deep) 0%, var(--deep-2) 48%, var(--product-bg-deep) 100%);
  color: var(--ink);
}

.back-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

.back-link:hover {
  color: var(--ink);
}

.legal-header h1 {
  max-width: 18ch;
  font-size: clamp(2.1rem, 3.6vw, 3rem);
}

.updated {
  margin: 16px 0 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legal-intro {
  max-width: 58ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.legal-main {
  padding-block: clamp(48px, 5.4vw, 76px) clamp(64px, 7vw, 96px);
  background: linear-gradient(to bottom, var(--light) 0%, var(--light-alt) 100%);
  color: var(--ink-dark);
}

.legal-body {
  width: min(760px, calc(100% - 48px));
  margin-inline: auto;
}

/* Plain-language précis before the clauses. */
.summary {
  display: block;
  margin-bottom: clamp(36px, 4vw, 52px);
  padding: 22px 24px;
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: rgba(47, 143, 138, 0.08);
  color: var(--muted-dark);
  font-size: 0.95rem;
}

.summary strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-dark);
  font-size: 1rem;
}

.legal-section {
  margin-top: clamp(30px, 3.4vw, 44px);
}

.legal-section:first-of-type {
  margin-top: 0;
}

.legal-section h2 {
  margin-bottom: 14px;
  font-size: clamp(1.15rem, 1.5vw, 1.35rem);
  font-weight: 720;
  letter-spacing: -0.008em;
}

.legal-section h3 {
  margin-top: 22px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.legal-section p,
.legal-section li {
  color: var(--muted-dark);
  font-size: 0.97rem;
}

.legal-section p {
  margin: 0 0 14px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul,
.legal-section ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.legal-section li {
  margin-bottom: 7px;
}

.legal-section a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(47, 143, 138, 0.4);
  text-underline-offset: 3px;
}

.legal-section a:hover {
  text-decoration-color: var(--accent-strong);
}

/* Data table used by the privacy policy */
.data-table {
  width: 100%;
  margin: 0 0 14px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--muted-dark);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--ink-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* Numbered instructions on the deletion page */
.steps {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: deletion-step;
}

.steps li {
  position: relative;
  margin-bottom: 14px;
  padding-left: 42px;
  counter-increment: deletion-step;
}

.steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 750;
  content: counter(deletion-step);
}

.contact-card {
  margin-top: clamp(36px, 4vw, 52px);
  padding: 26px 28px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--white);
}

.contact-card h2 {
  margin-bottom: 10px;
  font-size: 1.15rem;
  font-weight: 720;
}

.contact-card p {
  margin: 0 0 12px;
  color: var(--muted-dark);
  font-size: 0.97rem;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: clamp(36px, 4vw, 52px);
  padding-top: 26px;
  border-top: 1px solid var(--border-light);
}

.legal-links a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--pill);
  background: var(--white);
  color: var(--ink-dark);
  font-size: 0.82rem;
  font-weight: 620;
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.legal-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
    --radius-lg: 22px;
    --radius-md: 14px;
  }

  body {
    font-size: 16px;
  }

  .shell {
    width: min(100% - 32px, var(--shell));
  }

  .product-brand img {
    width: 30px;
    height: 30px;
  }

  .product-brand span {
    font-size: 0.9rem;
  }

  .site-nav {
    gap: 0;
  }

  .site-nav a {
    padding-inline: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .legal-body {
    width: min(100% - 32px, 760px);
  }

  .legal-header h1 {
    font-size: clamp(1.8rem, 8vw, 2.3rem);
  }

  .summary,
  .contact-card {
    padding: 18px 20px;
  }

  .legal-section p,
  .legal-section li {
    font-size: 0.94rem;
  }

  .footer-bottom {
    padding-block: 34px;
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .footer-identity {
    gap: 0;
    justify-items: center;
  }

  .footer-copyright {
    justify-self: center;
  }
}

/* The legal header carries four routes; narrow phones keep only the two the
   stores link to directly. Every route stays reachable from the body links and
   the footer. */
@media (max-width: 560px) {
  .site-nav .nav-delete {
    display: none;
  }
}

@media (max-width: 430px) {
  .site-nav .nav-terms {
    display: none;
  }
}

/* Inline links inside the summary callout sit in running text. */
.summary a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-decoration-color: rgba(47, 143, 138, 0.4);
  text-underline-offset: 3px;
}
