/* ── MODAL OVERLAY ── */
#quiz-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 18, 24, 0.55);
  backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
#quiz-overlay.open { display: flex; }

.modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  animation: scaleIn 0.3s ease;
  box-shadow: 0 32px 80px rgba(26, 18, 24, 0.2);
}

/* ── MODAL HEADER ── */
.modal-header {
  padding: 22px 28px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.progress-track {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--wine);
  transition: width 0.4s ease;
  border-radius: 1px;
}

.step-counter {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 16px;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.modal-close:hover { border-color: var(--wine); color: var(--wine); }

/* ── MODAL BODY ── */
.modal-body {
  padding: 30px 28px 26px;
  animation: slideRight 0.2s ease both;
}

.quiz-step-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  color: var(--text);
}
.quiz-step-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  font-weight: 300;
}

/* ── OPTION CARDS ── */
.options-grid {
  display: grid;
  gap: 10px;
}
.options-grid--2col { grid-template-columns: 1fr 1fr; }
.options-grid--1col { grid-template-columns: 1fr; }

.option-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.option-card:hover:not(.active) { border-color: var(--border-2); background: var(--bg-3); }
.option-card.active { border-color: var(--wine); background: var(--wine-soft); }

.option-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--faint);
  flex-shrink: 0;
  transition: all 0.15s;
}
.option-card.active .option-icon { border-color: var(--wine-light); background: var(--wine-soft); color: var(--wine); }

.option-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
  transition: color 0.15s;
}
.option-card.active .option-label { color: var(--text); }
.option-desc { display: block; font-size: 11px; color: var(--faint); line-height: 1.4; font-weight: 300; }

/* ── FACE MAP ── */
.facemap-wrap {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.facemap-instructions {
  flex: 1;
  min-width: 140px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}
.facemap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.facemap-tag {
  padding: 4px 10px;
  background: var(--wine-soft);
  border: 1px solid var(--wine-light);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 500;
  color: var(--wine);
}

/* ── STEP FOOTER ── */
.step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.btn-back {
  font-size: 13px;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-family: var(--sans);
  transition: border-color 0.15s, color 0.15s;
}
.btn-back:hover { border-color: var(--border); color: var(--text); }
.btn-back.hidden { visibility: hidden; }

.btn-next {
  padding: 12px 32px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.01em;
}
.btn-next.active   { background: var(--wine); color: #fff; cursor: pointer; }
.btn-next.active:hover { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(92, 26, 43, 0.3); }
.btn-next.disabled { background: var(--border); color: var(--faint); cursor: not-allowed; }

/* ── RESULT ── */
.result-header {
  padding: 24px 28px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.result-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--wine-soft);
  border: 1px solid var(--wine-light);
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wine);
  margin-bottom: 12px;
}
.result-header h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
  color: var(--text);
}
.result-header p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  font-weight: 300;
}

.result-body { padding: 22px 28px 28px; }

.result-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}

.proc-list { margin-bottom: 16px; }
.proc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 9px;
  font-weight: 300;
}
.proc-item::before {
  content: '';
  width: 14px;
  height: 1px;
  background: var(--wine);
  flex-shrink: 0;
}

.result-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}
.result-meta-card {
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.meta-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 4px; }
.meta-value { font-size: 13px; font-weight: 500; color: var(--text); }

.result-divider { height: 1px; background: var(--border); margin: 20px 0; }

.result-form-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.result-form-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.75;
  font-weight: 300;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.2s, background 0.2s;
}
.form-input:focus   { border-color: var(--wine); background: #fff; }
.form-input::placeholder { color: var(--faint); }
.form-input.error   { border-color: #C9667A; }

.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--wine);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: none;
  font-family: var(--sans);
  margin-top: 4px;
  letter-spacing: 0.01em;
  transition: transform 0.2s, box-shadow 0.2s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(92, 26, 43, 0.28); }

.privacy-note {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  margin-top: 12px;
  font-weight: 300;
}

/* ── SUCCESS ── */
.quiz-success {
  display: none;
  padding: 56px 28px;
  text-align: center;
}
.success-icon {
  font-size: 24px;
  color: var(--wine);
  margin-bottom: 18px;
  opacity: 0.7;
}
.quiz-success h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}
.quiz-success p {
  font-size: 14px;
  color: var(--muted);
  max-width: 300px;
  margin: 0 auto 28px;
  line-height: 1.8;
  font-weight: 300;
}
