:root {
  --bg: #ece7de;
  --panel: rgba(255, 252, 247, 0.96);
  --line: rgba(31, 26, 20, 0.12);
  --text: #1f1a14;
  --muted: #665d52;
  --accent: #b87c35;
  --accent-deep: #8f5721;
  --success: #295f47;
  --danger: #a34132;
  --shadow: 0 24px 80px rgba(38, 26, 12, 0.14);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(184, 124, 53, 0.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(31, 26, 20, 0.12), transparent 30%),
    linear-gradient(180deg, #f2ede6 0%, #e7dfd6 100%);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.4;
  pointer-events: none;
}

.page-shell { position: relative; overflow: hidden; }

.page-noise {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(31, 26, 20, 0.05) 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  mix-blend-mode: multiply;
  opacity: 0.18;
  pointer-events: none;
}

.layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 1200px;
  padding: 20px;
  margin: 0 auto;
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 251, 245, 0.96) 0%, rgba(245, 238, 228, 0.92) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}

.brand-mark::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f5d8ab 0%, #b87c35 100%);
  box-shadow: 0 0 0 6px rgba(184, 124, 53, 0.12);
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-content .eyebrow {
  margin: 0;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  font-size: 0.72rem;
  white-space: nowrap;
}

.hero-content h1 {
  margin: 0;
  font-family: "Prata", serif;
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.3;
}

.form-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 252, 247, 0.7) 0%, rgba(250, 246, 240, 0.9) 100%);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.app-shell {
  display: grid;
  gap: 18px;
}

.app-shell,
.step-card,
.field,
.success-card,
.review-card {
  animation: rise-in 0.55s ease both;
}

.progress-card,
.content-grid,
.step-card,
.review-card,
.success-card {
  border: 1px solid rgba(31, 26, 20, 0.08);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(31, 26, 20, 0.08);
}

.progress-card {
  position: sticky;
  top: 20px;
  z-index: 25;
  padding: 16px;
  backdrop-filter: blur(18px);
}

.progress-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: flex-start;
}

.progress-head h2,
.step-card h2,
.review-card h2,
.success-card h2 {
  margin: 0;
  font-family: "Prata", serif;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.progress-head p,
.step-card p,
.review-card p,
.success-card p,
.empty-value,
.field-help,
.field-error {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.6;
}

.progress-track {
  height: 6px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 26, 20, 0.08);
}

.progress-fill {
  width: var(--progress, 0%);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, #e1b772 100%);
  transition: width 0.28s ease;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.progress-step {
  padding: 10px 10px 11px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 26, 20, 0.06);
}

.progress-step.is-active {
  border-color: rgba(184, 124, 53, 0.34);
  background: rgba(255, 246, 232, 0.88);
}

.progress-step.is-complete {
  background: rgba(41, 95, 71, 0.08);
}

.progress-step strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.progress-step span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 16px;
}

.step-card,
.review-card,
.success-card {
  padding: 22px;
}

.step-card {
  display: grid;
  gap: 18px;
}

.step-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.step-index {
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(31, 26, 20, 0.06);
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.fields-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(31, 26, 20, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
}

.field.is-full { grid-column: auto; }

.field.is-error {
  border-color: rgba(163, 65, 50, 0.35);
  background: rgba(255, 245, 243, 0.85);
}

.field-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.field-header label {
  font-weight: 700;
  line-height: 1.4;
  font-size: 0.95rem;
}

.field-badge {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(31, 26, 20, 0.045);
  color: var(--muted);
  font-size: 0.72rem;
}

.field-help, .field-error { font-size: 0.88rem; line-height: 1.45; }
.field-error { color: var(--danger); }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  min-height: 52px;
  padding: 14px 16px;
  line-height: 1.25;
  font: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(184, 124, 53, 0.42);
  box-shadow: 0 0 0 4px rgba(184, 124, 53, 0.12);
  transform: translateY(-1px);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.button:focus-visible,
.link-button:focus-visible,
.radio-option input:focus-visible + span {
  outline: 2px solid rgba(184, 124, 53, 0.48);
  outline-offset: 2px;
}

textarea { min-height: 124px; resize: vertical; }

.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.radio-option { position: relative; }
.radio-option input { position: absolute; opacity: 0; pointer-events: none; }

.radio-option span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  transition: all 0.2s ease;
}

.radio-option input:checked + span {
  border-color: rgba(184, 124, 53, 0.42);
  background: rgba(255, 244, 226, 0.95);
  color: var(--accent-deep);
  box-shadow: 0 10px 24px rgba(184, 124, 53, 0.14);
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.button, .link-button { appearance: none; border: none; cursor: pointer; font: inherit; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: 0.7; }

.button-primary {
  background: linear-gradient(135deg, #b87c35 0%, #d39c5b 100%);
  color: #fffaf4;
  box-shadow: 0 18px 30px rgba(184, 124, 53, 0.2);
}

.button-secondary {
  background: rgba(31, 26, 20, 0.06);
  color: var(--text);
}

.link-button { padding: 0; background: none; color: var(--accent-deep); font-weight: 700; }

.review-grid { display: grid; gap: 12px; margin-top: 16px; }

.submit-card {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(31, 26, 20, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.submit-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.submit-card p {
  margin: 0;
  color: var(--muted);
}

.submit-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.meta-line {
  margin-top: 10px;
  font-size: 0.86rem;
  color: var(--muted);
}

.review-section {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(31, 26, 20, 0.08);
}

.review-section h3 { margin: 0 0 12px; font-size: 1rem; }
.review-items { display: grid; gap: 12px; }

.review-item { padding-top: 12px; border-top: 1px solid rgba(31, 26, 20, 0.08); }
.review-item:first-child { border-top: none; padding-top: 0; }
.review-item strong { display: block; margin-bottom: 6px; font-size: 0.92rem; }

.success-card { max-width: 760px; }

.draft-status {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.draft-status.is-saved {
  color: var(--success);
  font-weight: 700;
}

.success-badge {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(41, 95, 71, 0.1);
  color: var(--success);
  font-weight: 800;
  margin-bottom: 20px;
}

.empty-value { font-style: italic; }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
  .hero-header { flex-direction: column; text-align: center; gap: 16px; }
  .hero-content { text-align: center; flex-direction: column; }
  .layout { padding: 16px; }
  .fields-grid { grid-template-columns: 1fr; }
  .field.is-full { grid-column: auto; }
  .step-topline, .actions { flex-direction: column; align-items: stretch; }
}

@media (max-width: 640px) {
  .hero-header, .step-card, .review-card, .success-card, .progress-card { padding: 18px; }
  .hero-content h1 { font-size: 1.06rem; }
  .progress-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-header { flex-direction: column; align-items: flex-start; }
}
