/* ===========================================================
   Form 8938 Guide — site stylesheet
   =========================================================== */

:root {
  --navy-900: #0a2540;
  --navy-800: #0f3a5f;
  --navy-700: #15578a;
  --navy-100: #e8f1f8;
  --gold-500: #0f9d63;
  --gold-400: #10b981;
  --gold-100: #e2f7ee;
  --ink-900: #1b2530;
  --ink-700: #3d4a58;
  --ink-500: #64748b;
  --gray-100: #f4f6f8;
  --gray-200: #e7ebef;
  --gray-300: #d7dee5;
  --white: #ffffff;
  --success: #1b7a4a;
  --danger: #b3261e;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(10, 47, 71, 0.08), 0 1px 2px rgba(10, 47, 71, 0.06);
  --shadow-md: 0 6px 20px rgba(10, 47, 71, 0.12);
  --max-width: 1180px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--navy-900);
  line-height: 1.25;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; color: var(--ink-700); }

ul, ol { color: var(--ink-700); }

/* ---------- Top disclaimer strip ---------- */
.top-disclaimer {
  background: var(--navy-900);
  color: #cfe0ec;
  font-size: 0.8rem;
  text-align: center;
  padding: 7px 16px;
  letter-spacing: 0.01em;
}
.top-disclaimer strong { color: var(--gold-400); }

/* ---------- Header ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-900);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--navy-800), var(--navy-900));
  color: var(--gold-400);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; color: var(--navy-900); }
.brand-tagline { font-size: 0.72rem; color: var(--ink-500); }

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.primary-nav a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--ink-700);
  font-size: 0.92rem;
  font-weight: 600;
}
.primary-nav a:hover { background: var(--navy-100); color: var(--navy-900); text-decoration: none; }
.primary-nav a.active { color: var(--navy-900); background: var(--gold-100); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 9px 10px;
  cursor: pointer;
}
.nav-toggle span { width: 20px; height: 2px; background: var(--navy-900); display: block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.06s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--gold-500); color: var(--white); }
.btn-primary:hover { background: var(--gold-400); box-shadow: var(--shadow-sm); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,0.12); }
.btn-secondary { background: var(--navy-800); color: var(--white); }
.btn-secondary:hover { background: var(--navy-700); }
.btn-ghost { background: transparent; border-color: var(--gray-300); color: var(--ink-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 85% -10%, #123f5f 0%, var(--navy-900) 55%, var(--navy-900) 100%);
  color: var(--white);
  padding: 64px 0 76px;
}
.hero .container { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { color: var(--white); }
.hero p.lead { color: #cfe0ec; font-size: 1.1rem; max-width: 54ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero-badges { display: flex; gap: 18px; margin-top: 30px; flex-wrap: wrap; }
.hero-badge { font-size: 0.82rem; color: #b9cfdf; display: flex; align-items: center; gap: 8px; }
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-400); }

.hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(2px);
}
.hero-card h3 { color: var(--gold-400); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.hero-card ul { margin: 0; padding-left: 20px; color: #dfe9f1; }
.hero-card li { margin-bottom: 10px; font-size: 0.94rem; }

/* Page header variant (non-home pages) */
.page-hero {
  background: linear-gradient(160deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  padding: 46px 0;
}
.page-hero h1 { color: var(--white); margin-bottom: 8px; }
.page-hero p { color: #cfe0ec; max-width: 70ch; margin: 0; }
.breadcrumb { font-size: 0.82rem; color: #a9c3d6; margin-bottom: 14px; }
.breadcrumb a { color: #cfe0ec; }
.breadcrumb span { margin: 0 6px; }

/* ---------- Sections / layout ---------- */
section { padding: 60px 0; }
section.alt { background: var(--gray-100); }
.section-head { max-width: 70ch; margin-bottom: 34px; }
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-500);
  background: var(--gold-100);
  padding: 5px 11px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.card p:last-child { margin-bottom: 0; }
.card .icon {
  width: 44px; height: 44px;
  border-radius: 9px;
  background: var(--navy-100);
  color: var(--navy-800);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}

.stat-row { display: flex; gap: 32px; flex-wrap: wrap; }
.stat { min-width: 140px; }
.stat .num { font-family: var(--font-serif); font-size: 2.1rem; color: var(--navy-900); font-weight: 700; }
.stat .label { font-size: 0.85rem; color: var(--ink-500); }

/* Callout boxes */
.callout {
  border-left: 4px solid var(--navy-800);
  background: var(--navy-100);
  padding: 18px 22px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
}
.callout.warn { border-color: var(--danger); background: #fbeceb; }
.callout.success { border-color: var(--success); background: #eaf6ef; }
.callout.gold { border-color: var(--gold-500); background: var(--gold-100); }
.callout p:last-child { margin-bottom: 0; }
.callout h4 { margin-bottom: 8px; font-size: 1rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--gray-200); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; min-width: 480px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--gray-200); }
thead th { background: var(--navy-900); color: var(--white); font-family: var(--font-serif); }
tbody tr:nth-child(even) { background: var(--gray-100); }
tbody tr:last-child td { border-bottom: none; }

/* Steps */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 28px 52px;
  border-left: 2px solid var(--gray-300);
  margin-left: 20px;
}
.steps li:last-child { border-left-color: transparent; padding-bottom: 4px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -22px;
  top: 0;
  width: 40px; height: 40px;
  background: var(--navy-800);
  color: var(--gold-400);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700;
}
.steps h3 { margin-bottom: 6px; }

/* FAQ accordion */
.faq-item { border-bottom: 1px solid var(--gray-200); }
.faq-item:first-child { border-top: 1px solid var(--gray-200); }
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 18px 4px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--navy-900);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-question .plus { color: var(--gold-500); font-size: 1.4rem; transition: transform 0.2s ease; flex-shrink: 0; }
.faq-item.open .faq-question .plus { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq-item.open .faq-answer { max-height: 800px; }
.faq-answer-inner { padding: 0 4px 20px; color: var(--ink-700); }

/* Article cards / listing */
.article-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.article-card-top {
  height: 8px;
  background: linear-gradient(90deg, var(--navy-800), var(--gold-500));
}
.article-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.article-meta { font-size: 0.78rem; color: var(--ink-500); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.article-card h3 { margin-bottom: 10px; font-size: 1.15rem; }
.article-card p { flex: 1; }
.read-more { font-weight: 700; font-size: 0.9rem; margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; }

/* Article page body */
.article-body { max-width: 74ch; margin: 0 auto; }
.article-body h2 { margin-top: 1.6em; }
.article-body h3 { margin-top: 1.3em; }
.article-body ul, .article-body ol { padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-header { max-width: 74ch; margin: 0 auto 30px; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tag { font-size: 0.76rem; background: var(--navy-100); color: var(--navy-800); padding: 4px 10px; border-radius: 20px; font-weight: 600; }

.byline { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 0.88rem; color: var(--ink-500); }
.byline .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--navy-800); color: var(--gold-400);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700;
}

.related-articles { border-top: 1px solid var(--gray-200); margin-top: 50px; padding-top: 40px; }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-900));
  color: var(--white);
  border-radius: var(--radius);
  padding: 42px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.cta-band h2 { color: var(--white); margin-bottom: 6px; }
.cta-band p { color: #cfe0ec; margin: 0; }

/* Forms */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; color: var(--navy-900); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--gray-300);
  border-radius: 7px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink-900);
  background: var(--white);
}
.form-field textarea { resize: vertical; min-height: 130px; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(18, 79, 118, 0.15);
}
.form-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.85rem; color: var(--ink-500); }
.form-consent input { width: auto; margin-top: 3px; }
.form-note { font-size: 0.82rem; color: var(--ink-500); }

.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: 0.92rem; }
.alert-success { background: #eaf6ef; color: var(--success); border: 1px solid #bfe3cd; }
.alert-error { background: #fbeceb; color: var(--danger); border: 1px solid #f0c4c1; }

/* ad slot placeholders — clearly marked so the site owner knows where AdSense units go */
.ad-slot {
  border: 1px dashed var(--gray-300);
  background: var(--gray-100);
  color: var(--ink-500);
  font-size: 0.78rem;
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  margin: 30px 0;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: #b9cfdf; padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.3fr 1fr; gap: 32px; padding-bottom: 36px; }
.footer-col h3 { color: var(--white); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 9px; }
.footer-col a { color: #b9cfdf; font-size: 0.9rem; }
.footer-col a:hover { color: var(--gold-400); }
.footer-brand .brand-name { color: var(--white); }
.footer-brand p { color: #9fb8ca; font-size: 0.9rem; margin-top: 12px; }
.footer-disclaimer { border-top: 1px solid rgba(255,255,255,0.12); padding: 22px 24px; font-size: 0.8rem; color: #9fb8ca; }
.footer-disclaimer a { color: #cfe0ec; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: #8fa9bc;
}
.footer-bottom a { color: #8fa9bc; }

/* ---------- Cookie bar ---------- */
.cookie-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--navy-900);
  color: #dfe9f1;
  padding: 18px 20px;
  z-index: 999;
  box-shadow: 0 -6px 24px rgba(0,0,0,0.25);
  transform: translateY(120%);
  transition: transform 0.3s ease;
}
.cookie-bar.visible { transform: translateY(0); }
.cookie-bar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.cookie-bar p { color: #dfe9f1; margin: 0; font-size: 0.88rem; max-width: 60ch; }
.cookie-bar a { color: var(--gold-400); }
.cookie-bar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.cookie-modal {
  position: fixed; inset: 0;
  background: rgba(10, 20, 30, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.cookie-modal.visible { display: flex; }
.cookie-modal-inner {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.cookie-option {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
}
.cookie-option p { margin: 4px 0 0; font-size: 0.85rem; }
.cookie-option input { margin-top: 4px; flex-shrink: 0; width: 18px; height: 18px; }
.cookie-modal-actions { display: flex; gap: 10px; margin-top: 22px; }

.cookie-reopen {
  position: fixed;
  bottom: 18px;
  left: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--navy-800);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 900;
  display: none;
}
.cookie-reopen.visible { display: block; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.small { font-size: 0.85rem; color: var(--ink-500); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .container { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .primary-nav {
    position: fixed;
    top: 0; right: 0;
    width: min(300px, 82vw);
    height: 100vh;
    background: var(--white);
    box-shadow: -8px 0 24px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    padding: 90px 24px 24px;
    overflow-y: auto;
  }
  .primary-nav.open { transform: translateX(0); }
  .primary-nav ul { flex-direction: column; }
  .nav-toggle { display: flex; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .brand-tagline { display: none; }
}
