/* ── Reset & base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #f4f4f7;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Layout ───────────────────────────────────────────────── */
.page-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

/* ── Header ───────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a2e;
  border-bottom: 3px solid #4a6fa5;
  padding-bottom: 0.5rem;
}

/* ── Instructions ─────────────────────────────────────────── */
.instructions-box {
  background: #eef3fb;
  border-left: 4px solid #4a6fa5;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  color: #2c3e6b;
  font-size: 0.95rem;
}

/* ── Error ────────────────────────────────────────────────── */
.error-box {
  background: #fde8e8;
  border-left: 4px solid #c0392b;
  padding: 1rem 1.25rem;
  border-radius: 4px;
  margin-bottom: 2rem;
  color: #7b1f1f;
}

/* ── Subject name field ───────────────────────────────────── */
.subject-field {
  background: #fff;
  border: 1px solid #dde1eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.subject-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.subject-field input[type="text"] {
  width: 100%;
  max-width: 400px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #bcc3d6;
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.15s;
}

.subject-field input[type="text"]:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.15);
}

.required { color: #c0392b; }

/* ── Section heading ──────────────────────────────────────── */
.section-heading {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4a6fa5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid #d0daea;
}

.section-note {
  font-size: 0.88rem;
  color: #5a6a80;
  font-style: italic;
  margin-bottom: 1rem;
}

/* ── Question card ────────────────────────────────────────── */
.question-card {
  background: #fff;
  border: 1px solid #dde1eb;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: border-color 0.2s;
}

.question-card.error {
  border-color: #c0392b;
  background: #fff8f8;
}

.question-id {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a6fa5;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

.question-text {
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.97rem;
  color: #1a1a2e;
}

/* ── Radio options ────────────────────────────────────────── */
.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.option-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  border-radius: 5px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.92rem;
}

.option-item label:hover {
  background: #f0f4fb;
  border-color: #bccde0;
}

.option-item input[type="radio"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: #4a6fa5;
  width: 1rem;
  height: 1rem;
}

.option-item input[type="radio"]:checked + .option-label-content {
  color: #2c5282;
  font-weight: 500;
}

.option-letter {
  font-weight: 700;
  color: #4a6fa5;
  min-width: 1.1rem;
}

/* ── Details field ────────────────────────────────────────── */
.details-field {
  margin-top: 0.9rem;
}

.details-field label {
  font-size: 0.82rem;
  color: #6b7a99;
  display: block;
  margin-bottom: 0.3rem;
}

.details-field textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid #ccd3e0;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  color: #1a1a2e;
  transition: border-color 0.15s;
}

.details-field textarea:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.12);
}

/* ── Free-text question ───────────────────────────────────── */
.freetext-field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #ccd3e0;
  border-radius: 5px;
  font-size: 0.92rem;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  color: #1a1a2e;
  transition: border-color 0.15s;
}

.freetext-field textarea:focus {
  outline: none;
  border-color: #4a6fa5;
  box-shadow: 0 0 0 3px rgba(74,111,165,0.12);
}

/* ── Validation banner ────────────────────────────────────── */
.validation-banner {
  background: #fde8e8;
  border: 1px solid #e57373;
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: #7b1f1f;
  margin-bottom: 1.25rem;
  font-size: 0.93rem;
}

/* ── Submit ───────────────────────────────────────────────── */
.submit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
  gap: 1rem;
}

.submit-btn {
  background: #4a6fa5;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.submit-btn:hover { background: #3a5a8a; }
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled {
  background: #9aadca;
  cursor: not-allowed;
}

/* ── Version selector ─────────────────────────────────────── */
.version-selector {
  margin-top: 1.75rem;
}

.version-selector-heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 1rem;
}

.version-cards {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.version-card {
  flex: 1;
  min-width: 240px;
  background: #fff;
  border: 2px solid #dde1eb;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.version-card:hover {
  border-color: #4a6fa5;
  box-shadow: 0 4px 12px rgba(74,111,165,0.15);
  transform: translateY(-2px);
}

.version-card:active { transform: scale(0.99); }

.version-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.version-badge {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.03em;
}

.version-badge--basic {
  background: #dbeafe;
  color: #1d4ed8;
}

.version-badge--robust {
  background: #ede9fe;
  color: #6d28d9;
}

.version-duration {
  font-size: 0.8rem;
  color: #6b7a99;
}

.version-card-desc {
  font-size: 0.88rem;
  color: #4a5568;
  line-height: 1.5;
}

/* ── Question prompt (for textarea questions) ─────────────── */
.question-prompt {
  font-size: 0.87rem;
  color: #5a6a80;
  font-style: italic;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

/* ── Back button ──────────────────────────────────────────── */
.back-btn {
  background: transparent;
  color: #4a6fa5;
  border: 1px solid #4a6fa5;
  border-radius: 6px;
  padding: 0.7rem 1.25rem;
  font-size: 0.93rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.back-btn:hover {
  background: #eef3fb;
}

/* ── Confirmation ─────────────────────────────────────────── */
.confirmation-box {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #f0f7ee;
  border: 1px solid #a8d5a2;
  border-radius: 8px;
  margin-top: 2rem;
}

.confirmation-box p {
  font-size: 1.25rem;
  color: #2d6a27;
  font-weight: 600;
}
