/* ==========================================================================
   Will Draft India — design tokens
   Palette: ink navy (trust/authority) + paper ivory (document surface)
   + brass accent (seal/signature moments) + sage (confirmed/valid state)
   Typography: serif for document-voice content, humanist sans for UI/forms.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink-900: #16233a;
  --ink-700: #1f3350;
  --ink-500: #3d5372;
  --paper-100: #faf7f0;
  --paper-200: #f1ece0;
  --brass-500: #a67c3d;
  --brass-700: #8a6530;
  --sage-500: #5c7a64;
  --alert-600: #b54834;
  --slate-500: #6b7280;
  --slate-200: #e2e5ea;
  --white: #ffffff;

  --font-display: "Source Serif 4", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius-sm: 4px;
  --radius-md: 10px;
  --shadow-card: 0 1px 2px rgba(22, 35, 58, 0.06), 0 6px 20px rgba(22, 35, 58, 0.06);
  --max-width: 880px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink-900);
  background: var(--paper-100);
  line-height: 1.55;
}

img { max-width: 100%; display: block; }

a { color: var(--ink-700); }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--brass-500);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink-900);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

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

/* --- Site header / nav --- */

.site-header {
  background: var(--ink-900);
  color: var(--paper-100);
  padding: 16px 0;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; }
.site-header a { color: var(--paper-100); text-decoration: none; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.brand .seal {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--brass-500), var(--brass-700));
  display: inline-block;
}
.site-nav { display: flex; gap: 20px; font-size: 0.92rem; }
.site-nav a { opacity: 0.85; }
.site-nav a:hover { opacity: 1; text-decoration: underline; }

/* --- Hero / marketing --- */

.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(166,124,61,0.10), transparent),
    var(--paper-100);
  border-bottom: 1px solid var(--paper-200);
}
.hero__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass-700);
  margin-bottom: 14px;
  font-weight: 600;
}
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 14ch;
}
.hero p.lede {
  font-size: 1.15rem;
  color: var(--ink-500);
  max-width: 60ch;
  margin: 18px 0 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--ink-900); color: var(--paper-100); }
.btn--primary:hover { background: var(--ink-700); }
.btn--secondary { background: var(--white); color: var(--ink-900); border-color: var(--slate-200); }
.btn--secondary:hover { border-color: var(--ink-500); }
.btn--ghost { background: transparent; color: var(--ink-700); border-color: transparent; }
.btn--ghost:hover { text-decoration: underline; }
.btn--danger { background: var(--white); color: var(--alert-600); border-color: var(--alert-600); }
.btn--danger:hover { background: var(--alert-600); color: var(--white); }
.btn--small { padding: 6px 12px; font-size: 0.82rem; }

/* --- Info sections on homepage --- */

.section { padding: 56px 0; }
.section--muted { background: var(--paper-200); }
.section h2 { font-size: 1.6rem; margin-bottom: 20px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--white);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-card);
}
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card p { color: var(--ink-500); font-size: 0.95rem; margin: 0; }

.can-cannot { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.can-cannot ul { padding-left: 1.2em; margin: 0; }
.can-cannot li { margin-bottom: 8px; }
.can-cannot .can h3 { color: var(--sage-500); }
.can-cannot .cannot h3 { color: var(--alert-600); }

.footer {
  background: var(--ink-900);
  color: var(--paper-200);
  padding: 40px 0 24px;
  font-size: 0.85rem;
}
.footer a { color: var(--paper-200); }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.footer .fine-print { color: var(--slate-500); margin-top: 14px; }

/* --- Wizard (drafting flow) --- */

#app-root { padding: 40px 0 80px; }
.wizard { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.wizard__progress {
  height: 6px;
  background: var(--paper-200);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.wizard__progress-fill { height: 100%; background: var(--brass-500); transition: width 0.25s ease; }
.wizard__step-label { color: var(--slate-500); font-size: 0.82rem; margin: 0 0 6px; }
.wizard__title { font-size: 1.7rem; margin-bottom: 24px; }
.wizard__nav { display: flex; justify-content: space-between; margin-top: 32px; }

.disclaimer-box {
  background: var(--white);
  border-left: 4px solid var(--brass-500);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.checkbox-row { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; }

.screening-list { display: flex; flex-direction: column; gap: 14px; }
.screening-row {
  border: 1px solid var(--paper-200);
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.screening-row legend { font-size: 0.92rem; padding: 0; }
.screening-row label { margin-left: 12px; font-size: 0.88rem; white-space: nowrap; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; }
.field span { font-weight: 600; color: var(--ink-700); }
.field input, .field select, .field textarea {
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 9px 11px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  background: var(--white);
}
.hint { color: var(--slate-500); font-size: 0.88rem; }

.record-card {
  background: var(--white);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}
.record-card .checkbox-row { grid-column: span 2; }
.record-card button[data-action="remove"] { grid-column: span 2; justify-self: start; }

.allocation-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; grid-column: span 2; }
.allocation-row select { flex: 2; }
.allocation-row input { flex: 1; }

.banner {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 0.9rem;
}
.banner ul { margin: 0; padding-left: 1.2em; }
.banner--warning { background: #fbf1e0; border: 1px solid #e8c27a; color: #6b4b12; }
.banner--error { background: #fbe9e6; border: 1px solid #e7a698; color: #7c2d1c; }

.review-section {
  background: var(--white);
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.review-section h2 { font-size: 1.05rem; margin-bottom: 6px; }

.will-preview-frame-wrapper {
  border: 1px solid var(--paper-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 70vh;
  margin: 20px 0;
  box-shadow: var(--shadow-card);
}
.will-preview-frame { width: 100%; height: 100%; border: 0; background: var(--white); }
.generated-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --- Consent banner / panel --- */

.consent-banner, .consent-panel {
  position: fixed;
  left: 20px; right: 20px; bottom: 20px;
  max-width: 760px;
  margin: 0 auto;
  background: var(--ink-900);
  color: var(--paper-100);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  z-index: 1000;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
}
.consent-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.consent-banner a { text-decoration: underline; }
.consent-banner__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent-panel { top: 10%; bottom: auto; }
.consent-row { border-bottom: 1px solid rgba(255,255,255,0.15); padding: 10px 0; }
.consent-row p { margin: 4px 0 0; color: var(--slate-200); font-size: 0.85rem; }
.consent-panel__actions { margin-top: 16px; text-align: right; }

@media (max-width: 720px) {
  .form-grid, .record-card, .grid-3, .can-cannot { grid-template-columns: 1fr; }
  .record-card .checkbox-row, .record-card button[data-action="remove"] { grid-column: span 1; }
}
