/*
 * LegioPilot public site - shared stylesheet.
 * Single source of truth for header, navigation, footer, buttons, breadcrumbs,
 * cards, notices, FAQ, newsletter and other components reused across every
 * public page. Page-specific layout lives in a small page-level <style> block
 * or in assets/article.css for long-form guide pages.
 */

:root {
  --ink: #04120f;
  --ink-soft: #0d221d;
  --panel: #0f2a24;
  --emerald: #16b981;
  --emerald-dark: #0c8f66;
  --lime: #a7f3d0;
  --mint: #ecfdf5;
  --paper: #f6fbf9;
  --white: #ffffff;
  --text: #12332b;
  --muted: #5a726b;
  --line: #d7e8e2;
  --amber: #fef3c7;
  --amber-ink: #92600a;
  --danger: #fde4e1;
  --danger-ink: #a53228;
  --shadow: 0 24px 60px rgba(4, 18, 15, 0.14);
  --shadow-sm: 0 10px 30px rgba(4, 18, 15, 0.08);
  --radius: 20px;
  --max: 1160px;
  --header-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transform: translateY(-160%);
  transition: transform 150ms ease;
}
.skip-link:focus { transform: translateY(0); }

section[id], [data-scroll-target] { scroll-margin-top: 96px; }

.container {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

/* ---------- Header / navigation ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(246, 251, 249, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(215, 232, 226, 0.7);
}

.nav {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(150deg, var(--emerald), var(--emerald-dark));
  box-shadow: 0 10px 22px rgba(22, 185, 129, 0.32);
  flex: 0 0 auto;
}

.brand-sub {
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald-dark);
  margin-left: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--muted);
  flex-wrap: nowrap;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  flex: 0 0 auto;
}

.nav-links a:not(.button) {
  position: relative;
  padding-bottom: 4px;
  white-space: nowrap;
  transition: color 150ms ease;
}
.nav-links a:not(.button)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--emerald);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
}
.nav-links a:not(.button):hover { color: var(--ink); }
.nav-links a:not(.button).active { color: var(--ink); font-weight: 700; }
.nav-links a:not(.button).active::after { transform: scaleX(1); }
.nav-links a.button.active {
  box-shadow: 0 0 0 3px rgba(22, 185, 129, 0.4), 0 14px 30px rgba(12, 143, 102, 0.28);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
  cursor: pointer;
  white-space: nowrap;
}
.button:hover { transform: translateY(-2px); }

.button-primary {
  color: var(--white);
  background: var(--emerald-dark);
  box-shadow: 0 14px 30px rgba(12, 143, 102, 0.28);
}
.button-primary:hover { background: #0a7d59; }

.button-ghost {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.button-outline {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.07);
}

.button-small { min-height: 44px; padding: 0 18px; font-size: 0.9rem; border-radius: 10px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 0; }

/* ---------- Breadcrumbs ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 22px;
  font-size: 0.86rem;
  list-style: none;
  padding: 0;
}
.crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.crumbs a { color: var(--lime); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .crumb-current { color: rgba(236, 253, 245, 0.6); }
.crumbs .crumb-sep { color: rgba(236, 253, 245, 0.4); }

/* Light-background variant (e.g. on paper sections) */
.crumbs.crumbs-light a { color: var(--emerald-dark); }
.crumbs.crumbs-light .crumb-current { color: var(--muted); }
.crumbs.crumbs-light .crumb-sep { color: var(--muted); }

/* ---------- Secondary-page hero (articles, landing pages) ---------- */
.page-hero {
  position: relative;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.76);
  background:
    radial-gradient(circle at 12% 10%, rgba(22, 185, 129, 0.22), transparent 38%),
    linear-gradient(155deg, var(--ink), var(--ink-soft));
}
.page-hero-inner { padding: 78px 0 70px; max-width: 940px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  margin-bottom: 18px;
  border: 1px solid rgba(167, 243, 208, 0.25);
  border-radius: 999px;
  color: var(--lime);
  background: rgba(22, 185, 129, 0.1);
  font-size: 0.82rem;
  font-weight: 750;
}
.tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }

.page-hero h1 {
  max-width: 900px;
  margin: 0 0 21px;
  color: #fff;
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  line-height: 1.07;
  letter-spacing: -0.052em;
}
.lead { max-width: 820px; margin: 0 0 27px; font-size: clamp(1.04rem, 2vw, 1.23rem); color: rgba(236, 253, 245, 0.73); }
.meta { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 0.86rem; color: rgba(236, 253, 245, 0.56); }

@media (max-width: 720px) {
  .page-hero-inner { padding: 55px 0; }
  .page-hero h1 { font-size: clamp(2.25rem, 12vw, 3.35rem); }
}

/* ---------- Sections & headings ---------- */
h1, h2, h3 { margin-top: 0; line-height: 1.15; }

.section { padding: clamp(40px, 5vw, 64px) 0; }
.section-paper { background: var(--paper); }
.section-ink { background: var(--ink); color: rgba(236, 253, 245, 0.74); }

.kicker {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald-dark);
}
.section-ink .kicker { color: var(--emerald); }

.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head h2 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  letter-spacing: -0.035em;
  color: var(--ink);
  margin-bottom: 14px;
}
.section-ink .section-head h2 { color: var(--white); }
.section-head p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.section-ink .section-head p { color: rgba(236, 253, 245, 0.66); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.card-num {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  margin-bottom: 22px;
  border-radius: 12px;
  background: var(--mint);
  color: var(--emerald-dark);
  font-weight: 900;
}
.card-num.card-badge {
  width: auto;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.card h3 { font-size: 1.14rem; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 8px; }
.card p { margin: 0; color: var(--muted); }
.cards-timeline { grid-template-columns: repeat(4, 1fr); }

/* ---------- Notices / callouts / checklists ---------- */
.notice {
  margin: 27px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--emerald-dark);
  border-radius: 0 13px 13px 0;
  background: var(--mint);
}
.notice.warn { border-color: #d59b00; background: var(--amber); color: #614900; }
.notice.danger { border-color: var(--danger-ink); background: var(--danger); color: #6e2019; }
.notice strong { color: inherit; }

.checks { display: grid; gap: 10px; padding: 0; margin: 22px 0 29px; list-style: none; }
.checks li {
  position: relative;
  margin: 0;
  padding: 14px 16px 14px 47px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}
.checks li::before {
  content: "\2713";
  position: absolute;
  left: 15px;
  top: 13px;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--emerald-dark);
  font-size: 0.75rem;
  font-weight: 900;
}

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 860px; }
details {
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 24px;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--emerald-dark); font-size: 1.3rem; font-weight: 400; flex: 0 0 auto; }
details[open] summary::after { content: "\2212"; }
details p { margin: 14px 0 0; color: var(--muted); }
details p:last-child { margin-bottom: 0; }

/* ---------- Pilot / contact box ---------- */
.pilot {
  display: grid;
  grid-template-columns: 1fr 0.78fr;
  gap: 44px;
  align-items: stretch;
  padding: 52px;
  border-radius: 28px;
  background: linear-gradient(140deg, var(--emerald-dark), var(--panel));
  color: rgba(236, 253, 245, 0.82);
  box-shadow: var(--shadow);
}
.pilot h2 { color: var(--white); font-size: clamp(1.7rem, 3vw, 2.5rem); letter-spacing: -0.035em; margin-bottom: 14px; }
.pilot > div > p { margin-top: 0; }
.pilot-list { display: grid; gap: 12px; margin: 26px 0 0; padding: 0; list-style: none; }
.pilot-list li { display: flex; gap: 11px; align-items: flex-start; }
.pilot-list li::before {
  content: "\2713";
  flex: 0 0 auto;
  display: grid; place-items: center;
  width: 23px; height: 23px;
  margin-top: 2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  font-weight: 900;
  font-size: 0.8rem;
}

.contact-box { padding: 30px; border-radius: 20px; background: var(--white); color: var(--text); }
.contact-box h3 { color: var(--ink); font-size: 1.2rem; margin-bottom: 6px; }
.contact-box p { color: var(--muted); margin-top: 0; }
.contact-box .button { width: 100%; margin-top: 14px; }
.contact-meta { display: grid; gap: 8px; margin-top: 20px; color: var(--muted); font-size: 0.88rem; }
.contact-meta span::before { content: "\2022"; color: var(--emerald-dark); margin-right: 8px; font-weight: 900; }

/* ---------- Knowledge base cards ---------- */
.kb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.kb-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 36px 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(circle at 100% 0%, rgba(22, 185, 129, 0.08), transparent 60%), var(--paper);
  box-shadow: var(--shadow-sm);
}
.kb-card h3 { margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); }
.kb-card p { margin: 0; color: var(--muted); font-size: 1rem; flex: 1 0 auto; }
.kb-card .button { align-self: flex-start; margin-top: 4px; }
.kb-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 780px) {
  .kb-grid { grid-template-columns: 1fr; }
  .kb-card { padding: 28px 24px; }
  .kb-card .button { width: 100%; }
}

/* ---------- Compact newsletter banner ---------- */
.news-band { padding: 44px 0; }
.news-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 30px 40px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: radial-gradient(circle at 100% 0%, rgba(22, 185, 129, 0.08), transparent 60%), var(--mint);
  box-shadow: var(--shadow-sm);
}
.news-cta-body { max-width: 660px; }
.news-cta-body .kicker { margin-bottom: 8px; }
.news-cta h2 { font-size: clamp(1.35rem, 2.4vw, 1.85rem); letter-spacing: -0.03em; color: var(--ink); margin-bottom: 8px; }
.news-cta p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.news-cta-action .button { white-space: nowrap; }

@media (max-width: 780px) {
  .news-band { padding: 36px 0; }
  .news-cta { grid-template-columns: 1fr; padding: 26px 24px; }
  .news-cta-action .button { width: 100%; }
}

/* ---------- Newsletter form (full card + inline variant) ---------- */
.newsletter-card {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
  padding: 52px 56px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: radial-gradient(circle at 100% 0%, rgba(22, 185, 129, 0.08), transparent 60%), var(--white);
  box-shadow: var(--shadow-sm);
}
.newsletter-card .kicker { margin-bottom: 14px; }
.newsletter-card h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -0.035em; color: var(--ink); margin-bottom: 12px; }
.newsletter-lead { max-width: 560px; margin: 0 auto 28px; color: var(--muted); font-size: 1.05rem; }

.newsletter-inline {
  margin: 34px 0 40px;
  padding: 26px 28px;
  border: 1px solid #bde6d7;
  border-radius: 19px;
  background: radial-gradient(circle at 100% 0%, rgba(22, 185, 129, 0.08), transparent 60%), var(--mint);
  box-shadow: var(--shadow-sm);
}
.newsletter-inline-body strong { display: block; color: var(--ink); font-size: 1.2rem; line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 8px; }
.newsletter-inline-body p { margin: 0 0 17px; color: var(--muted); font-size: 0.95rem; }

.newsletter-form { max-width: 560px; margin: 0 auto; }
.newsletter-inline .newsletter-form { margin: 0; max-width: none; }
.newsletter-fields { display: flex; gap: 12px; }
.newsletter-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  color: var(--text);
  font-size: 1rem;
}
.newsletter-input::placeholder { color: var(--muted); opacity: 0.85; }
.newsletter-input:focus-visible { outline: 3px solid var(--emerald); outline-offset: 2px; }
.newsletter-submit { flex: 0 0 auto; min-height: 52px; border: 0; }
.newsletter-error { display: block; margin: 10px 0 0; color: var(--danger-ink); font-size: 0.88rem; text-align: left; }
.newsletter-error:empty { display: none; }
.newsletter-message {
  max-width: 560px;
  margin: 20px auto 0;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.55;
  text-align: left;
}
.newsletter-message.is-success { background: var(--mint); border: 1px solid rgba(22, 185, 129, 0.3); color: var(--emerald-dark); }
.newsletter-message.is-error { background: var(--danger); border: 1px solid rgba(220, 38, 38, 0.28); color: var(--danger-ink); }
.newsletter-form.is-sent { display: none; }
.newsletter-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.input--hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}
.newsletter-consent-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 560px;
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}
.newsletter-inline .newsletter-consent-check { max-width: none; margin: 15px 0 0; background: var(--white); font-size: 0.82rem; }
.newsletter-consent-check input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--emerald-dark);
  cursor: pointer;
}
.newsletter-consent-check a { color: var(--emerald-dark); text-decoration: underline; text-underline-offset: 2px; }

@media (max-width: 560px) {
  .newsletter-card { padding: 34px 24px; }
  .newsletter-fields { flex-direction: column; }
  .newsletter-submit { width: 100%; }
}

/* ---------- Footer ---------- */
footer {
  padding: 40px 0;
  background: var(--ink);
  color: rgba(236, 253, 245, 0.6);
  font-size: 0.86rem;
}
.footer-row { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
footer .brand { color: var(--white); }
.footer-legal { max-width: 560px; line-height: 1.55; }
.footer-meta { display: grid; gap: 6px; text-align: right; }
.footer-policy-link { text-decoration: underline; text-underline-offset: 3px; }
.footer-policy-link:hover, .footer-meta a:hover { color: var(--white); }

@media (max-width: 680px) {
  .footer-row { flex-direction: column; }
  .footer-meta { text-align: left; }
}

/* ---------- Navigation breakpoint ----------
   Measured: brand + full desktop nav needs ~835-880px before container
   margins. 920px gives comfortable clearance so the desktop nav never
   collides with the brand or the CTA before the mobile menu takes over. */
@media (max-width: 920px) {
  .container { width: min(calc(100% - 28px), var(--max)); }

  .menu-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 14px;
    right: 14px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
  }
  .header.menu-open .nav-links {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav-links a:not(.button) { display: block; padding: 12px; min-height: 44px; }
  .nav-links .button { width: 100%; margin-top: 4px; }
}

@media (max-width: 980px) {
  .cards, .cards-timeline { grid-template-columns: 1fr 1fr; }
  .pilot { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .cards, .cards-timeline { grid-template-columns: 1fr; }
  .pilot { padding: 32px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
