:root {
  --bg: #f4f2ee;
  --panel: #fffdf8;
  --text: #22201d;
  --muted: #6b665f;
  --line: #ddd6ca;
  --line-strong: #b9ad9d;
  --primary: #244b45;
  --primary-dark: #173632;
  --primary-soft: #dce8e3;
  --accent: #b05f35;
  --danger: #9d2f24;
  --focus: #1b6f9b;
  --shadow: 0 24px 70px rgba(54, 46, 37, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(36, 75, 69, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(176, 95, 53, 0.1), transparent 32%),
    var(--bg);
  color: var(--text);
  font-family:
    "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px 18px;
}

.quiz-panel {
  width: min(920px, 100%);
  border: 1px solid rgba(185, 173, 157, 0.8);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 42px);
}

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

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

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.progress-label {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 8px 12px;
  white-space: nowrap;
}

.progress-track {
  height: 8px;
  margin: 28px 0 34px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5db;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #5f7e6d);
  transition: width 180ms ease;
}

.question-root {
  min-height: 372px;
}

.question-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.helper {
  max-width: 720px;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field.full {
  grid-column: 1 / -1;
}

.company-unsure-option {
  align-self: end;
  min-height: 46px;
  padding: 10px 12px;
}

.field label,
.upload-box label {
  color: #3a3631;
  font-size: 0.94rem;
  font-weight: 700;
}

.field input,
.field select,
.upload-box input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fffefa;
  color: var(--text);
  padding: 10px 12px;
}

.field input:focus,
.field select:focus,
.upload-box input:focus,
.option:focus-within,
.button:focus-visible {
  outline: 3px solid rgba(27, 111, 155, 0.24);
  outline-offset: 2px;
}

.options {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffefa;
  padding: 14px;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.option:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.option input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.option-text {
  display: grid;
  gap: 3px;
}

.option-label {
  color: var(--text);
  font-weight: 650;
}

.option-helper {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.follow-up {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f0;
  padding: 18px;
}

.follow-up h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  letter-spacing: 0;
}

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

.form-error {
  margin: 18px 0 0;
  border-left: 4px solid var(--danger);
  color: var(--danger);
  font-weight: 700;
  padding: 8px 12px;
}

.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 750;
  padding: 10px 18px;
  cursor: pointer;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.button-primary {
  background: var(--primary);
  color: #fffdf8;
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.button-secondary {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--primary-dark);
}

.button-secondary:hover:not(:disabled) {
  background: #eee7dc;
}

.summary-panel {
  max-width: 980px;
}

.summary-header {
  margin-bottom: 24px;
}

.summary-state {
  color: var(--muted);
  font-size: 1rem;
}

.error-state {
  color: var(--danger);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: #f1ebe0;
  color: #3a3631;
  font-size: 0.88rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-pill {
  display: inline-flex;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 800;
  padding: 5px 10px;
}

.status-required {
  background: #dce8e3;
  color: #173632;
}

.status-not-required {
  background: #e9e4da;
  color: #4d4841;
}

.status-pending-review {
  background: #f3ddc8;
  color: #773c1c;
}

.upload-box {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f0;
  padding: 18px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.copy-status {
  min-height: 20px;
  margin: 0;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 700;
}

.summary-note {
  margin: 22px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.upload-intake {
  display: grid;
  gap: 18px;
}

.upload-intake-header {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.upload-intake-header h1 {
  max-width: 780px;
}

.upload-intake-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

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

.document-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefa;
  padding: 16px;
}

.document-card h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.document-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.file-control {
  display: grid;
  gap: 8px;
}

.file-control input {
  width: 100%;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fbf8f0;
  padding: 12px;
}

.selected-file {
  min-height: 20px;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.upload-actions p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.upload-guidance,
.success-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f0;
  color: var(--muted);
  line-height: 1.5;
  padding: 14px 16px;
}

.success-panel {
  border-color: rgba(36, 75, 69, 0.25);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.success-panel h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.success-panel p {
  margin: 0;
}

.success-panel p + p {
  margin-top: 8px;
  font-weight: 700;
}

.admin-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.admin-card .button {
  justify-self: start;
}

.file-list {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.file-list a {
  color: var(--primary-dark);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .page-shell {
    align-items: start;
    padding: 14px;
  }

  .panel-header,
  .actions,
  .copy-row {
    flex-direction: column;
  }

  .panel-header {
    display: grid;
  }

  .progress-label {
    justify-self: start;
  }

  .field-grid,
  .split-grid,
  .copy-row,
  .document-grid {
    grid-template-columns: 1fr;
  }

  .company-unsure-option {
    align-self: stretch;
  }

  .question-root {
    min-height: 440px;
  }

  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .upload-actions {
    display: grid;
  }
}
