/* =========================================================
   Small-Business Legal Pages Generator
   Palette: deep ink navy + warm amber accent + cool slate
   Fonts:  Sora (display) / Inter (body)
   ========================================================= */

:root {
  --ink:        #131a2b;   /* deep navy */
  --ink-soft:   #20293f;
  --paper:      #f6f7fb;   /* cool off-white, NOT cream */
  --card:       #ffffff;
  --slate:      #5a6680;
  --slate-soft: #8b95ad;
  --line:       #e3e7f0;
  --accent:     #f5a623;   /* warm amber */
  --accent-deep:#d98a0b;
  --accent-ink: #5a3c00;
  --indigo:     #3b4bd8;   /* trust blue, used sparingly */
  --indigo-soft:#eef0ff;
  --warn-bg:    #fff7e8;
  --warn-line:  #f3cd83;
  --ok:         #1f9d6b;
  --radius:     14px;
  --radius-sm:  9px;
  --shadow:     0 10px 30px rgba(19,26,43,.08);
  --shadow-sm:  0 2px 8px rgba(19,26,43,.06);
  --maxw:       1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, .brand-text, .tab, .btn {
  font-family: "Sora", "Inter", system-ui, sans-serif;
}

a { color: var(--indigo); }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------- Header ---------------- */
.site-header {
  background: var(--ink);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px;
  background: var(--accent);
  color: var(--ink);
  border-radius: 8px;
  font-weight: 700;
  font-size: 20px;
}
.brand-text { font-size: 1.05rem; letter-spacing: .2px; font-weight: 500; }
.brand-text strong { color: var(--accent); font-weight: 700; }
.header-cta {
  color: #cfd6e6;
  text-decoration: none;
  font-size: .85rem;
  border: 1px solid rgba(255,255,255,.18);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.header-cta:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------------- Hero ---------------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(59,75,216,.18), transparent 60%),
    var(--ink);
  color: #fff;
  padding: clamp(40px, 7vw, 76px) 0 clamp(54px, 8vw, 96px);
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(1.9rem, 4.6vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -.02em;
  max-width: 16ch;
}
.lede {
  margin: 0;
  font-size: clamp(1rem, 1.6vw, 1.18rem);
  color: #c6cde0;
  max-width: 60ch;
}

/* ---------------- Disclaimer ---------------- */
.disclaimer {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-line);
  border-left-width: 6px;
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 0 0 4px;
}
.disclaimer--top { margin-top: -34px; position: relative; z-index: 5; box-shadow: var(--shadow-sm); }
.disclaimer--bottom { margin: 32px 0; }
.disclaimer p { margin: 0; font-size: .92rem; color: #4a3a16; }
.disclaimer strong { color: #6b4e0e; }
.disclaimer-badge {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 1rem;
  margin-top: 1px;
}

/* ---------------- Layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 28px;
  align-items: start;
  padding-top: 34px;
  padding-bottom: 10px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 3vw, 30px);
}
.form-panel { position: sticky; top: 78px; }
.panel-title { margin: 0 0 4px; font-size: 1.18rem; letter-spacing: -.01em; }
.panel-sub { margin: 0 0 20px; color: var(--slate); font-size: .88rem; }

/* ---------------- Form ---------------- */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.req { color: var(--accent-deep); }
input[type=text], input[type=email], input[type=url], input[type=date], select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}

/* Toggles */
.toggles {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 16px 8px;
  margin: 20px 0;
}
.toggles legend {
  font-size: .82rem;
  font-weight: 700;
  padding: 0 8px;
  color: var(--ink-soft);
}
.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  cursor: pointer;
  font-size: .9rem;
}
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-box {
  flex: none;
  width: 42px; height: 24px;
  background: #d6dbe7;
  border-radius: 999px;
  position: relative;
  transition: background .2s;
}
.toggle-box::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .2s;
}
.toggle input:checked + .toggle-box { background: var(--ok); }
.toggle input:checked + .toggle-box::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-box {
  outline: 3px solid var(--indigo-soft);
  outline-offset: 2px;
}
.toggle-label { color: var(--ink); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .92rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, background .18s, box-shadow .18s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(245,166,35,.32);
}
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-ghost.is-done { border-color: var(--ok); color: var(--ok); }
.btn-light {
  background: #fff;
  color: var(--ink);
}
.btn-light:hover { background: #f0f2fa; }
.form-note { margin: 12px 0 0; font-size: .85rem; color: #c0392b; min-height: 1em; }

/* ---------------- Output ---------------- */
.output-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.stamp { margin: 0; font-size: .8rem; color: var(--slate-soft); }
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--slate);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
}
.empty-emoji {
  font-family: "Sora", serif;
  font-size: 3rem;
  color: var(--line);
  margin: 0 0 8px;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: none;
  padding: 12px 14px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--indigo); border-bottom-color: var(--indigo); }
.tab:focus-visible { outline: 3px solid var(--indigo-soft); outline-offset: 2px; border-radius: 4px; }

.doc-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
}
.doc-toolbar .btn { padding: 9px 16px; font-size: .85rem; }

.doc-pane { }
.doc-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "Inter", system-ui, sans-serif;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink-soft);
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  margin: 0;
  max-height: 620px;
  overflow-y: auto;
}

/* ---------------- Capture + PV CTA ---------------- */
.capture-section {
  background: var(--ink);
  color: #fff;
  margin-top: 40px;
  padding: clamp(44px, 6vw, 72px) 0;
}
.capture-grid {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  gap: 24px;
  align-items: stretch;
}
.capture-card {
  background: var(--ink-soft);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: clamp(24px, 3vw, 36px);
}
.capture-card h2 { margin: 0 0 12px; font-size: 1.35rem; letter-spacing: -.01em; }
.capture-card p { color: #c2cae0; margin: 0 0 18px; font-size: .95rem; }
.capture-card--pv {
  background: linear-gradient(160deg, var(--indigo), #2a36a8);
  border: none;
  display: flex;
  flex-direction: column;
}
.pv-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent) !important;
  margin: 0 0 8px !important;
}
.capture-card--pv .btn-light { margin-top: auto; align-self: flex-start; }

.capture-form { display: flex; gap: 10px; flex-wrap: wrap; }
.capture-form input {
  flex: 1 1 220px;
  min-width: 0;
  background: #fff;
}
.capture-msg { margin: 12px 0 0; font-size: .9rem; color: var(--accent); min-height: 1em; font-weight: 600; }
.capture-fine { font-size: .78rem !important; color: #8b95ad !important; margin: 12px 0 0 !important; }

/* ---------------- Footer ---------------- */
.site-footer {
  background: #0d1320;
  color: #aab3c9;
  padding: 30px 0;
}
.footer-inner p { margin: 0 0 6px; font-size: .88rem; }
.site-footer a { color: var(--accent); }
.footer-fine { color: #6b7591 !important; font-size: .8rem !important; }

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .form-panel { position: static; }
  .capture-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .header-cta { display: none; }
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* =========================================================
   PRINT — produces a clean PDF of the active document
   ========================================================= */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-header, .hero, .form-panel, .doc-toolbar, .tabs,
  .capture-section, .site-footer, .empty-state, .stamp,
  .output-head, .header-cta { display: none !important; }

  .wrap, .layout, .panel, .output-panel {
    display: block !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
  }

  /* Disclaimers DO print, on every page of the PDF */
  .disclaimer {
    background: #fff !important;
    border: 1.5px solid #000 !important;
    color: #000 !important;
    margin: 0 0 16pt !important;
    page-break-inside: avoid;
  }
  .disclaimer p, .disclaimer strong { color: #000 !important; }
  .disclaimer--top { margin-top: 0 !important; }

  /* Only the visible doc prints */
  .doc-pane[hidden] { display: none !important; }
  .doc-text {
    border: none !important;
    background: #fff !important;
    padding: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    font-size: 11pt !important;
    color: #000 !important;
    white-space: pre-wrap;
  }
  @page { margin: 18mm; }
}
