:root {
  --green-900: #102f2a;
  --green-800: #173c34;
  --green-700: #245247;
  --cream-100: #fbf7ee;
  --cream-200: #f3ead8;
  --cream-300: #e7d8bb;
  --gold-500: #c8a24a;
  --gold-600: #a9842c;
  --clay-500: #9a684f;
  --ink: #22201d;
  --muted: #746c61;
  --white: #fffdf8;
  --line: rgba(23, 60, 52, 0.16);
  --shadow: 0 18px 45px rgba(16, 47, 42, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(circle at top left, rgba(200, 162, 74, 0.16), transparent 32rem),
    linear-gradient(135deg, var(--cream-100), var(--cream-200));
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  background: linear-gradient(180deg, var(--green-900), var(--green-800));
  color: var(--cream-100);
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 253, 248, 0.16);
}
.brand-logo { width: 64px; height: 64px; }
.brand h1 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 2px 0 0;
  font-size: 1.55rem;
  line-height: 1.1;
}
.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-500);
  font-size: 0.72rem;
  font-weight: 800;
}

.nav-steps { display: grid; gap: 8px; }
.nav-step {
  width: 100%;
  border: 1px solid rgba(255, 253, 248, 0.13);
  background: rgba(255, 253, 248, 0.04);
  color: var(--cream-100);
  border-radius: 16px;
  padding: 14px 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: 180ms ease;
}
.nav-step span {
  color: var(--gold-500);
  font-weight: 800;
  font-size: 0.8rem;
}
.nav-step:hover,
.nav-step.active {
  background: rgba(255, 253, 248, 0.13);
  border-color: rgba(200, 162, 74, 0.55);
}

.progress-card {
  margin-top: auto;
  border: 1px solid rgba(255, 253, 248, 0.15);
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(255, 253, 248, 0.06);
}
.progress-header { display: flex; justify-content: space-between; align-items: center; }
.progress-track {
  margin: 12px 0;
  height: 10px;
  background: rgba(255, 253, 248, 0.12);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-600), var(--gold-500));
  border-radius: inherit;
  transition: width 250ms ease;
}
.progress-card p { color: rgba(255, 253, 248, 0.76); margin: 0; font-size: 0.9rem; line-height: 1.45; }

.main-content {
  padding: 36px clamp(20px, 4vw, 58px) 64px;
  max-width: 1280px;
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 28px;
}
.hero h2 {
  max-width: 830px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2rem, 4vw, 4.35rem);
  line-height: 0.96;
  color: var(--green-900);
  margin: 0;
}
.hero-copy {
  max-width: 780px;
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.65;
}
.hero-panel {
  border-radius: var(--radius-lg);
  background: var(--green-800);
  color: var(--cream-100);
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.hero-panel strong { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 500; }
.hero-panel small { line-height: 1.55; color: rgba(255, 253, 248, 0.72); }
.tag {
  width: fit-content;
  background: rgba(200, 162, 74, 0.16);
  color: var(--gold-500);
  border: 1px solid rgba(200, 162, 74, 0.45);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.view { display: none; }
.view.active { display: block; animation: fadeIn 220ms ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.section-heading { margin: 18px 0; }
.section-heading h3 {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3vw, 2.8rem);
  line-height: 1.02;
  font-weight: 500;
  color: var(--green-900);
  margin: 0;
}
.section-heading p:not(.eyebrow) { color: var(--muted); max-width: 760px; line-height: 1.6; }

.card {
  background: rgba(255, 253, 248, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
label {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--green-900);
}
label.full { grid-column: 1 / -1; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  transition: 160ms ease;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(200, 162, 74, 0.9);
  box-shadow: 0 0 0 4px rgba(200, 162, 74, 0.13);
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: 180ms ease;
}
.button.primary { background: var(--green-800); color: var(--cream-100); }
.button.primary:hover { background: var(--green-900); transform: translateY(-1px); }
.button.secondary { background: var(--cream-200); color: var(--green-900); border: 1px solid var(--line); }
.button.secondary:hover { background: var(--cream-300); transform: translateY(-1px); }
.button.ghost { background: transparent; color: inherit; border: 1px solid currentColor; opacity: 0.82; }
.button.ghost:hover { opacity: 1; }
.hidden { display: none !important; }
.action-row {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.story-card {
  min-height: 180px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: left;
  box-shadow: var(--shadow);
  display: grid;
  align-content: start;
  gap: 10px;
  color: var(--ink);
  transition: 180ms ease;
}
.story-card span { font-size: 2rem; }
.story-card strong { font-family: var(--font-serif); color: var(--green-900); font-size: 1.55rem; font-weight: 500; }
.story-card small { color: var(--muted); line-height: 1.45; }
.story-card:hover, .story-card.selected {
  border-color: rgba(200, 162, 74, 0.7);
  transform: translateY(-2px);
}
.story-card.selected { background: linear-gradient(180deg, #fffdf8, #f7efd9); }

.split-card {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}
h4 { color: var(--green-900); margin: 0 0 10px; font-size: 1.15rem; }
.card p { color: var(--muted); line-height: 1.6; }
.check-list, .task-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.check-list li::before { content: '✓'; color: var(--gold-600); font-weight: 900; margin-right: 8px; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.toolbar p { margin: 6px 0 0; }
.toolbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.questions-container { display: grid; gap: 18px; }
.question-card { padding: 22px; }
.question-meta { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.question-number,
.question-section {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 900;
}
.question-number { background: var(--green-800); color: var(--cream-100); }
.question-section { background: rgba(200, 162, 74, 0.18); color: var(--gold-600); }
.question-title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.42rem;
  line-height: 1.25;
}
.voice-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.record-status { color: var(--muted); font-size: 0.9rem; }
.audio-preview { width: 100%; margin-top: 12px; }
.recording { background: #fbefe9 !important; border-color: rgba(154, 104, 79, 0.35); }

.upload-card {
  min-height: 280px;
  display: grid;
  place-items: center;
  text-align: center;
  border-style: dashed;
  cursor: pointer;
  position: relative;
}
.upload-card input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-card.dragover { border-color: var(--gold-500); background: rgba(255, 253, 248, 0.95); }
.upload-visual {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-800);
  color: var(--cream-100);
  font-size: 2.4rem;
  margin-bottom: 8px;
}
.archive-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  margin-top: 18px;
}
.file-list { display: grid; gap: 10px; }
.file-list.empty { color: var(--muted); }
.file-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  padding: 12px;
}
.file-item small { color: var(--muted); }
.task-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.task-list input { width: auto; margin-top: 3px; }

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.deliverable-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--white);
  padding: 18px;
  display: grid;
  gap: 8px;
}
.deliverable-card span { font-size: 1.7rem; }
.deliverable-card strong { color: var(--green-900); }
.deliverable-card small { color: var(--muted); line-height: 1.45; }
.result-card { min-height: 280px; }
.result-placeholder { display: grid; place-items: center; text-align: center; min-height: 220px; }
.legacy-document {
  background: var(--white);
  padding: clamp(18px, 4vw, 44px);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
}
.legacy-document h2, .legacy-document h3 {
  font-family: var(--font-serif);
  color: var(--green-900);
  font-weight: 500;
}
.legacy-document h2 { font-size: 2.3rem; line-height: 1; margin: 0 0 8px; }
.legacy-document h3 { margin-top: 28px; font-size: 1.55rem; }
.legacy-document p, .legacy-document li { line-height: 1.68; color: #3d3934; }
.upsell-card {
  margin-top: 18px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main-content { padding-top: 26px; }
  .hero, .split-card, .archive-layout { grid-template-columns: 1fr; }
  .story-grid, .deliverables-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .form-grid, .story-grid, .deliverables-grid { grid-template-columns: 1fr; }
  .toolbar, .upsell-card { flex-direction: column; align-items: stretch; }
  .hero h2 { font-size: 2.35rem; }
  .sidebar { padding: 20px; }
  .main-content { padding-inline: 16px; }
  .card { padding: 18px; border-radius: 20px; }
}

@media print {
  body { background: white; }
  .sidebar, .hero, .section-heading, .deliverables-grid, .upsell-card, .nav-steps, .toolbar, .action-row { display: none !important; }
  .app-shell { display: block; }
  .main-content { padding: 0; max-width: none; }
  .view { display: none !important; }
  #view-legado { display: block !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .legacy-document { border: 0; padding: 0; }
}
