:root {
  --ink: #17312a;
  --forest: #174d3e;
  --forest-2: #246956;
  --leaf: #72a66f;
  --cream: #f7f3e9;
  --paper: #fffdfa;
  --plum: #8a2f78;
  --muted: #68776f;
  --line: #d7ddd7;
  --warning: #9c5b12;
  --danger: #a13b3b;
  --shadow: 0 18px 60px rgba(25, 55, 44, .12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--cream); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(150px, 240px) 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 10px clamp(18px, 4vw, 64px);
  background: rgba(255, 253, 250, .94);
  border-bottom: 1px solid rgba(23, 77, 62, .12);
  backdrop-filter: blur(14px);
}

.brand img { display: block; width: 205px; height: 58px; object-fit: contain; object-position: left center; }
.topnav { justify-self: center; display: flex; gap: 28px; }
.topnav a { text-decoration: none; color: var(--muted); font-weight: 700; font-size: .94rem; }
.topnav a:hover, .topnav a:focus-visible { color: var(--forest); }
.language-switcher { display: flex; padding: 4px; background: #edf1ec; border-radius: 999px; }
.language-switcher button { border: 0; background: transparent; color: var(--muted); border-radius: 999px; padding: 8px 10px; font-size: .78rem; font-weight: 800; cursor: pointer; }
.language-switcher button.active { color: white; background: var(--forest); }

#app { min-height: calc(100vh - 176px); }
.shell { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(70px, 9vw, 124px) 0 76px;
  background:
    radial-gradient(circle at 83% 26%, rgba(138, 47, 120, .18), transparent 27%),
    linear-gradient(135deg, #113b31 0%, #1e5d49 62%, #2e735d 100%);
  color: white;
}
.hero::after {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -70px;
  top: -40px;
  background: url("assets/image1.png") center/contain no-repeat;
  opacity: .24;
  filter: saturate(1.2);
}
.hero-inner { position: relative; z-index: 1; max-width: 720px; }
.eyebrow { margin: 0 0 18px; text-transform: uppercase; letter-spacing: .15em; font-weight: 800; font-size: .78rem; opacity: .8; }
h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.6rem, 6vw, 5.3rem); line-height: .98; font-weight: 500; letter-spacing: -.035em; }
.hero p { max-width: 660px; margin: 28px 0 0; color: rgba(255,255,255,.84); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 19px; border: 1px solid transparent; border-radius: 12px; background: var(--forest); color: white; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(23, 77, 62, .2); }
.btn-light { background: white; color: var(--forest); }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--forest); }
.btn-soft { background: #eaf3ee; color: var(--forest); }
.btn-danger { background: #f8e9e7; color: var(--danger); }

.section { padding: 68px 0; }
.section-tight { padding: 42px 0; }
.section-head { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 28px; }
.section-head h2, .page-head h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; font-weight: 500; }
.section-head p { max-width: 600px; margin: 0; color: var(--muted); line-height: 1.65; }

.journey-grid, .card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.journey-card, .card, .panel {
  background: var(--paper);
  border: 1px solid rgba(23, 77, 62, .12);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.journey-card { position: relative; padding: 28px; overflow: hidden; }
.journey-card::before { content: attr(data-step); position: absolute; right: 22px; top: 10px; color: rgba(23,77,62,.07); font: 700 5.5rem/1 Georgia,serif; }
.journey-card .icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 26px; border-radius: 14px; color: var(--forest); background: #eaf3ee; font-size: 1.4rem; }
.journey-card h3, .card h3 { margin: 0 0 10px; font-size: 1.08rem; }
.journey-card p, .card p { margin: 0; color: var(--muted); line-height: 1.55; }

.page-head { padding: 54px 0 28px; }
.breadcrumbs { margin-bottom: 14px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.breadcrumbs a { text-decoration: none; color: var(--forest-2); }
.lead { max-width: 760px; color: var(--muted); font-size: 1.05rem; line-height: 1.7; }
.prototype-flag { display: inline-flex; gap: 8px; align-items: center; margin-top: 18px; padding: 8px 12px; color: #6f4a13; background: #fff1cf; border: 1px solid #eddaa7; border-radius: 999px; font-size: .8rem; font-weight: 800; }

.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.choice-card { display: block; padding: 24px; text-decoration: none; cursor: pointer; }
.choice-card .choice-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 24px; border-radius: 50%; color: white; background: var(--forest); font-size: 1.45rem; }
.choice-card:hover { transform: translateY(-2px); border-color: rgba(23,77,62,.32); }
.choice-card small { display: block; margin-top: 12px; color: var(--plum); font-weight: 800; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; padding-bottom: 72px; }
.form-card { background: var(--paper); border: 1px solid rgba(23,77,62,.14); border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.form-header { padding: 32px clamp(20px, 4vw, 42px); color: white; background: linear-gradient(135deg, var(--forest), var(--forest-2)); }
.form-header h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.form-header p { max-width: 700px; margin: 14px 0 0; color: rgba(255,255,255,.8); line-height: 1.6; }
.form-body { padding: 12px clamp(20px, 4vw, 42px) 36px; }
.form-sidebar { position: sticky; top: 104px; display: grid; gap: 14px; }
.side-card { padding: 20px; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: 18px; }
.side-card h3 { margin: 0 0 10px; font-size: .95rem; }
.side-card p, .side-card li { color: var(--muted); font-size: .86rem; line-height: 1.55; }
.side-card ul { margin: 0; padding-left: 18px; }
.progress { height: 8px; overflow: hidden; margin: 12px 0 6px; background: #e0e6e1; border-radius: 99px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf), var(--forest)); border-radius: inherit; }

.question { padding: 28px 0; border-bottom: 1px solid var(--line); }
.question:last-child { border-bottom: 0; }
.question-title { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; font-weight: 800; line-height: 1.5; }
.question-number { flex: 0 0 auto; display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 9px; color: var(--forest); background: #eaf3ee; font-size: .8rem; }
.question-help { margin: -8px 0 16px 40px; color: var(--muted); font-size: .87rem; }
.field, textarea, input[type="text"], input[type="email"], input[type="number"] { width: 100%; border: 1px solid #bdc9c1; border-radius: 12px; background: white; padding: 13px 14px; color: var(--ink); outline: none; }
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36,105,86,.12); }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.option:hover { border-color: #9cb4a6; }
.option input { margin-top: 3px; accent-color: var(--forest); }
.options.inline { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.scale label { text-align: center; padding: 15px 6px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; font-weight: 800; }
.scale input { display: block; margin: 0 auto 7px; accent-color: var(--forest); }
.scale-anchors { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: .78rem; }
.words-grid { display: grid; gap: 14px; }
.words-row { display: grid; grid-template-columns: minmax(145px, .8fr) repeat(3, 1fr); gap: 8px; align-items: center; }
.words-row strong { font-size: .9rem; }
.matrix-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
.matrix { width: 100%; min-width: 640px; border-collapse: collapse; background: white; }
.matrix th, .matrix td { padding: 12px 10px; border: 1px solid var(--line); text-align: center; vertical-align: middle; }
.matrix th { background: #eef4f0; font-size: .8rem; }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; width: 34%; text-align: left; background: #f8faf8; }
.matrix input { accent-color: var(--forest); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 28px; }

.info-sheet { max-height: 420px; overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fbfcfa; }
.info-sheet p { color: #3f5048; line-height: 1.72; }
.consent-group { margin-top: 22px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; }
.consent-group h3 { margin: 0 0 12px; font-size: 1rem; }
.signature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }

.paper-preview { background: #e7e6e1; padding: 32px 0 72px; }
.paper-sheet { width: min(840px, calc(100% - 28px)); min-height: 1100px; margin: 0 auto 24px; padding: 58px 62px; background: white; box-shadow: 0 14px 55px rgba(0,0,0,.16); color: #111; }
.paper-sheet h1 { font-size: 2rem; text-align: center; }
.paper-sheet .paper-code { display: flex; justify-content: space-between; margin: 28px 0; padding: 14px; border: 1px solid #222; font: 700 .83rem/1.4 ui-monospace, monospace; }
.fake-qr { width: 64px; height: 64px; background: repeating-conic-gradient(#111 0 25%, #fff 0 50%) 0/12px 12px; border: 5px solid #fff; outline: 1px solid #111; }
.paper-question { margin: 24px 0; }
.paper-lines { height: 58px; margin-top: 12px; background: repeating-linear-gradient(to bottom, transparent 0 27px, #555 28px 29px); }
.paper-tools { position: sticky; top: 98px; z-index: 5; display: flex; justify-content: center; gap: 10px; padding: 14px; background: rgba(247,243,233,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }

.admin-shell { padding: 48px 0 80px; }
.admin-header { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 28px; }
.admin-header h1 { font-size: clamp(2rem, 4vw, 3.6rem); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric { padding: 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; }
.metric span { display: block; color: var(--muted); font-size: .82rem; font-weight: 700; }
.metric strong { display: block; margin-top: 8px; font-family: Georgia,serif; font-size: 2.3rem; font-weight: 500; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; margin-top: 18px; }
.panel { padding: 24px; box-shadow: none; }
.panel h2 { margin: 0 0 18px; font-size: 1.1rem; }
.bar-list { display: grid; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 130px 1fr 42px; gap: 10px; align-items: center; font-size: .85rem; }
.bar-track { height: 10px; background: #edf0ed; border-radius: 99px; overflow: hidden; }
.bar-track span { display: block; height: 100%; background: linear-gradient(90deg,var(--forest-2),var(--leaf)); border-radius: inherit; }
.status-list { display: grid; gap: 10px; }
.status-item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); }
.status-dot.review { background: #e6a735; }
.status-item small { color: var(--muted); }
.table-wrap { overflow-x: auto; margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table th, .data-table td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; font-size: .86rem; }
.data-table th { color: var(--muted); background: #f7f9f7; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.tag { display: inline-flex; padding: 5px 8px; border-radius: 99px; background: #e9f3ed; color: var(--forest); font-size: .72rem; font-weight: 800; }
.tag.paper { background: #f4e9f1; color: var(--plum); }
.upload-zone { display: grid; place-items: center; min-height: 220px; padding: 26px; border: 2px dashed #aebdb4; border-radius: 18px; text-align: center; background: #f8faf8; }
.upload-zone input { max-width: 100%; }

.site-footer { display: flex; justify-content: space-between; gap: 28px; align-items: center; padding: 26px clamp(18px,4vw,64px); color: #dce6e0; background: #102e27; font-size: .8rem; }
.site-footer strong, .site-footer span { display: block; }
.footer-logos { display: flex; align-items: center; gap: 18px; text-align: right; }
.footer-logos img { width: 84px; height: 32px; object-fit: contain; filter: brightness(0) invert(1); }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 380px; padding: 14px 18px; border-radius: 13px; color: white; background: var(--forest); box-shadow: var(--shadow); transform: translateY(30px); opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.empty-state { padding: 36px; text-align: center; color: var(--muted); }

@media (max-width: 880px) {
  .topbar { grid-template-columns: 1fr auto; gap: 10px; }
  .topnav { display: none; }
  .journey-grid, .card-grid, .choice-grid { grid-template-columns: 1fr; }
  .form-layout { grid-template-columns: 1fr; }
  .form-sidebar { position: static; grid-row: 1; grid-template-columns: 1fr 1fr; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .paper-sheet { padding: 38px 30px; }
}

@media (max-width: 590px) {
  .topbar { min-height: 68px; padding: 8px 14px; }
  .brand img { width: 146px; height: 48px; }
  .language-switcher button { padding: 7px 8px; }
  .hero { padding-top: 64px; }
  .hero::after { width: 360px; height: 360px; right: -150px; opacity: .17; }
  .section-head, .admin-header, .site-footer { align-items: flex-start; flex-direction: column; }
  .form-sidebar, .signature-grid { grid-template-columns: 1fr; }
  .words-row { grid-template-columns: 1fr; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
  .metric-grid { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 34px; }
  .footer-logos { text-align: left; }
}

@media print {
  @page { size: A4; margin: 15mm; }
  .topbar, .site-footer, .paper-tools, .form-sidebar, .form-actions, .prototype-flag, .toast { display: none !important; }
  body, #app, .paper-preview { background: white !important; }
  .paper-preview { padding: 0; }
  .paper-sheet { width: 100%; min-height: 0; margin: 0; padding: 0; box-shadow: none; page-break-after: always; }
  .form-layout { display: block; }
  .form-card { box-shadow: none; border: 0; }
  .form-header { color: #111; background: white; border-bottom: 2px solid #111; }
  .question { break-inside: avoid; }
}
