/*
  site.css — shared style of aviationsafetyapp.com (home, help, FAQ, support, contact, privacy, 404).
  Same palette as the app and its PDFs (brand blue #1565C0 / #0D47A1), system font, light and
  dark mode. No build step: Cloudflare Pages serves the Website folder as it is.
  Browsers may keep this file for hours: after changing it, raise the `?v=` number in the
  stylesheet link of every page (see _headers).
*/

:root {
  color-scheme: light dark;
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #1565c0;
  --brand-dark: #0d47a1;
  --brand-tint: #edf4fd;
  --danger: #b42318;
  --button: #1565c0;
  --button-hover: #0d47a1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --card: #111a2b;
    --ink: #f3f4f6;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --line: #1f2a3d;
    --brand: #60a5fa;
    --brand-dark: #93c5fd;
    --brand-tint: #13233d;
    --danger: #f87171;
    --button: #2563eb;
    --button-hover: #1d4ed8;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}

a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--card); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; z-index: 10; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1040px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 17px;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-dark); }

/* Layout */
main { display: block; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; margin: 0 auto; padding: 40px 20px 64px; }

h1, h2, h3 { color: var(--ink); line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 4vw, 44px); margin: 0 0 14px; }
h2 { font-size: 24px; margin: 40px 0 12px; }
h3 { font-size: 18px; margin: 28px 0 8px; }
p, li { max-width: 70ch; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 28px; }
.muted { color: var(--muted); }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-dark); background: var(--brand-tint);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}

/* Hero */
.hero { padding: 64px 0 40px; }
.hero .grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero .art {
  justify-self: center; width: min(320px, 80%); aspect-ratio: 1; border-radius: 22%;
  box-shadow: 0 20px 60px rgba(21, 101, 192, 0.25);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-weight: 600; font-size: 15px;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
}
.button.primary { background: var(--button); color: #fff; }
.button.primary:hover { background: var(--button-hover); color: #fff; }
.button.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { border-color: var(--brand); color: var(--brand-dark); }
.store-badge img { display: block; height: 44px; width: auto; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin: 8px 0 24px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { margin: 10px 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.icon {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-dark);
}
.icon svg { width: 22px; height: 22px; }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step; position: relative; padding: 16px 16px 16px 60px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); max-width: none;
}
.steps li::before {
  content: counter(step); position: absolute; left: 16px; top: 14px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--button); color: #fff; font-weight: 700; font-size: 15px;
}

/* Link list (help index, support) */
.list { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list a, .list .row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 18px; color: var(--ink); text-decoration: none;
}
.list a + a, .list a + .row, .list .row + a, .list .row + .row { border-top: 1px solid var(--line); }
.list a:hover { background: var(--brand-tint); }
.list .go { color: var(--brand); font-weight: 600; white-space: nowrap; }
.list .hint { color: var(--muted); font-size: 14px; }

/* Text pages */
.doc h2 { scroll-margin-top: 80px; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 4px 0; }
.note {
  border-left: 3px solid var(--brand); background: var(--brand-tint);
  padding: 12px 16px; border-radius: 0 10px 10px 0; margin: 18px 0;
}
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0 8px; }
.toc ol { margin: 6px 0 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.toc li { margin: 2px 0; break-inside: avoid; }
code, kbd { font-family: var(--mono); font-size: 0.92em; background: var(--brand-tint); padding: 1px 5px; border-radius: 5px; }
.updated { color: var(--muted); font-size: 14px; }

/* FAQ */
details {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 18px; margin: 10px 0;
}
details[open] { padding-bottom: 6px; }
summary {
  cursor: pointer; list-style: none; font-weight: 600; color: var(--ink);
  padding: 14px 0; display: flex; justify-content: space-between; gap: 12px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--brand); font-weight: 700; font-size: 20px; line-height: 1; }
details[open] summary::after { content: "–"; }

/* Contact form (contact.html) */
[hidden] { display: none !important; }
.small { font-size: 14px; }
.contact-form {
  display: grid; gap: 18px; margin: 8px 0 24px; padding: 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 600; color: var(--ink); font-size: 15px; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.field textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand);
}
.field .help { margin: 0; color: var(--muted); font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.form-actions p { margin: 0; }
.button:disabled { opacity: 0.6; cursor: progress; }
.form-status {
  margin: 0; padding: 10px 14px; border-radius: 10px; font-size: 15px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent);
}
/* Hidden trap field: off screen for people, still filled in by form-filling programs. */
.trap { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.notice {
  display: none; margin: 8px 0 24px; padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card);
}
.notice h2 { margin: 0 0 6px; font-size: 20px; }
.notice p { margin: 6px 0 0; }
.notice.success { border-color: color-mix(in srgb, #16a34a 45%, var(--line)); background: color-mix(in srgb, #16a34a 8%, var(--card)); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 7%, var(--card)); }
.notice.show, .notice:target { display: block; }
.notice:focus { outline: none; }
#sent:target ~ .contact-form { display: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 56px; }
.site-footer .inner {
  max-width: 1040px; margin: 0 auto; padding: 24px 20px 40px;
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: var(--muted); font-size: 14px;
}
.site-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); }

@media (max-width: 760px) {
  .hero { padding-top: 36px; }
  .hero .grid { grid-template-columns: 1fr; }
  .hero .art { display: none; }
  .toc ol { columns: 1; }
  .site-nav a { padding: 6px 8px; font-size: 14px; }
  .field-row { grid-template-columns: 1fr; }
  .contact-form { padding: 18px; }
}

/* Phones: the four menu links go on their own row under the name. */
@media (max-width: 560px) {
  .site-header .inner { flex-wrap: wrap; row-gap: 4px; padding-top: 10px; padding-bottom: 8px; }
  .brand { white-space: nowrap; }
  .site-nav { width: 100%; margin-left: -8px; }
}

@media print {
  .site-header, .site-footer, .skip { display: none; }
  body { background: #fff; color: #000; }
}
