:root {
  --bg: #f2ece2;
  --panel: #fffaf3;
  --ink: #2a1f17;
  --muted: #6b584b;
  --accent: #9a3412;
  --accent-2: #d97706;
  --line: #e8d8c3;
  --soft: #fff3df;
  --danger: #991b1b;
  --shadow: 0 14px 30px rgba(60, 32, 14, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans Devanagari", "Mangal", "Kohinoor Devanagari", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(217, 119, 6, 0.12), transparent 38%),
    radial-gradient(circle at 88% 14%, rgba(154, 52, 18, 0.12), transparent 42%),
    linear-gradient(180deg, #f6efe5, #efe6d8);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(360px, 1fr);
  gap: 20px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
}

.wizard-panel,
.preview-panel {
  min-height: calc(100vh - 36px);
}

.wizard-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-head,
.question-card,
.utility-card {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid rgba(232, 216, 195, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.panel-head {
  padding: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
}

.panel-head h1 {
  margin: 8px 0 4px;
  font-size: 28px;
  line-height: 1.15;
}

.subtext {
  margin: 0;
  color: var(--muted);
}

.progress-wrap {
  background: rgba(255, 250, 243, 0.92);
  border: 1px solid rgba(232, 216, 195, 0.8);
  border-radius: 14px;
  padding: 12px 14px;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.progress-bar {
  height: 8px;
  background: #f0e2cd;
  border-radius: 999px;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  transition: width 220ms ease;
}

.question-card {
  padding: 18px;
}

.question-section {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
}

.question-label {
  display: block;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  margin-bottom: 6px;
}

.question-hint {
  margin: 0 0 12px;
  color: var(--muted);
  min-height: 20px;
}

.input-host {
  min-height: 108px;
  display: grid;
  align-items: start;
}

.input-host input,
.input-host textarea,
.input-host select {
  width: 100%;
  border: 1px solid #d7c0a5;
  background: #fffefb;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}

.input-host textarea {
  min-height: 116px;
  resize: vertical;
}

.input-host input:focus,
.input-host textarea:focus,
.input-host select:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.file-help {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.actions,
.utility-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 12px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #b45309);
  color: #fff;
  box-shadow: 0 8px 16px rgba(154, 52, 18, 0.25);
}

.btn-secondary {
  background: #f4e7d2;
  color: var(--ink);
  border: 1px solid #e2cdae;
}

.btn-danger {
  background: #fee2e2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.utility-card {
  padding: 16px 18px;
}

.utility-card h2 {
  font-size: 17px;
  margin: 0 0 10px;
}

.small-note {
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 0;
}

.preview-panel {
  background: rgba(255, 250, 243, 0.56);
  border: 1px solid rgba(232, 216, 195, 0.8);
  border-radius: 22px;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
}

.biodata-page {
  width: min(100%, 794px);
  min-height: 1123px;
  background: #fff;
  color: #19130e;
  border: 1px solid #ead9c0;
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(33, 22, 13, 0.12);
  padding: 28px 28px 24px;
  position: relative;
  line-height: 1.3;
}

.biodata-page::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid #e5cfb4;
  border-radius: 6px;
  pointer-events: none;
}

.biodata-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: start;
  border-bottom: 2px solid #efd9bd;
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.doc-kicker {
  margin: 0;
  color: #a84317;
  font-weight: 700;
}

.biodata-header h2 {
  margin: 4px 0;
  font-size: 26px;
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  color: #6a574a;
}

.photo-box {
  width: 120px;
  height: 150px;
  border: 2px dashed #d2b48c;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fffaf4;
}

.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-box span {
  color: #99785d;
  font-weight: 600;
}

.biodata-section {
  position: relative;
  z-index: 1;
  margin-top: 8px;
}

.biodata-section h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: #8f370e;
  border-left: 4px solid #d97706;
  padding-left: 7px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 10px;
}

.info-row {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 6px;
  align-items: start;
  border-bottom: 1px dotted #edd8bf;
  padding: 1px 0 3px;
}

.info-row dt {
  font-weight: 700;
  color: #402d20;
}

.info-row dd {
  margin: 0;
  color: #241a13;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.25;
}

.long-text {
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .wizard-panel,
  .preview-panel {
    min-height: auto;
  }

  .preview-panel {
    padding: 12px;
  }

  .biodata-page {
    width: 100%;
    min-height: auto;
    padding: 20px 18px;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .biodata-header {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
    margin: 0;
  }

  .wizard-panel {
    display: none !important;
  }

  .app-shell {
    display: block;
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .preview-panel {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: #fff;
    box-shadow: none;
    overflow: visible;
    min-height: auto;
  }

  .biodata-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 12mm 12mm 10mm;
    line-height: 1.2;
    page-break-after: avoid;
  }

  .biodata-page::before {
    inset: 4mm;
  }

  .biodata-header {
    grid-template-columns: 1fr 30mm;
    gap: 8px;
    padding-bottom: 6px;
    margin-bottom: 8px;
  }

  .doc-kicker {
    font-size: 11px;
  }

  .biodata-header h2 {
    font-size: 20px;
    margin: 2px 0;
  }

  .subtitle {
    font-size: 11px;
  }

  .photo-box {
    width: 30mm;
    height: 38mm;
    border-width: 1px;
  }

  .biodata-section {
    margin-top: 5px;
  }

  .biodata-section h3 {
    font-size: 12px;
    margin-bottom: 4px;
    padding-left: 5px;
    border-left-width: 2px;
  }

  .info-grid {
    gap: 2px 6px;
  }

  .info-row {
    grid-template-columns: 28mm 1fr;
    gap: 3mm;
    padding: 0 0 1px;
    border-bottom: 0.3px dotted #d8b790;
    font-size: 10.5px;
    break-inside: avoid;
  }

  .info-row dt,
  .info-row dd,
  .long-text {
    line-height: 1.15;
  }

  .long-text {
    font-size: 10.5px;
  }
}
