/* ============================================================
   Car Valuation Study v2 — Styles
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --secondary: #64748b;
  --text: #1e293b;
  --text-secondary: #64748b;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* ============================================================
   Progress Bar
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--border);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  width: 0%;
  transition: width 0.3s ease;
}

.progress-label {
  position: fixed;
  top: 6px;
  right: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  z-index: 101;
}

/* ============================================================
   Pages (show/hide)
   ============================================================ */
.page {
  display: none;
  max-width: 680px;
  margin: 40px auto;
  padding: 0 16px;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 16px;
}

.card-header {
  margin-bottom: 16px;
}

.card-header h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
}

.section-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.section-intro {
  font-size: 16px;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ============================================================
   Welcome
   ============================================================ */
.welcome-header {
  text-align: center;
  margin-bottom: 16px;
}

.welcome-header h1 {
  font-size: 28px;
  font-weight: 700;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 4px;
}

.welcome-meta {
  text-align: center;
  margin-bottom: 20px;
}

.meta-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--text-secondary);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  margin: 0 4px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

/* ============================================================
   Consent
   ============================================================ */
.consent-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 16px;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.consent-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.consent-check label {
  font-size: 14px;
  cursor: pointer;
}

/* ============================================================
   Threshold Number Input
   ============================================================ */
.threshold-input-container {
  padding: 20px 0;
}

.input-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.input-group input[type="text"] {
  width: 200px;
  padding: 14px 16px;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s ease;
}

.input-group input[type="text"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-suffix {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-secondary);
}

.threshold-error {
  text-align: center;
  font-size: 14px;
  color: var(--error);
  margin-top: 8px;
}

/* ============================================================
   Category Belief Radio
   ============================================================ */
.category-belief-question {
  margin-top: 20px;
}

.question-label {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 10px;
}

.option-list.compact label {
  display: block;
  padding: 10px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.option-list.compact label:hover {
  background: #f8fafc;
  border-color: var(--primary);
}

.option-list.compact input[type="radio"] {
  margin-right: 8px;
}

/* ============================================================
   Example Choice (instructions page)
   ============================================================ */
.example-choice {
  margin: 20px 0;
  padding: 20px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.example-note {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
}

/* ============================================================
   Binary Choice Cards
   ============================================================ */
.choice-header {
  margin-bottom: 20px;
}

.choice-context {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.6;
}

/* Vehicle display */
.vehicle-display {
  text-align: center;
  margin: 20px 0;
}

.vehicle-image {
  max-width: 100%;
  width: 360px;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.vehicle-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-top: 12px;
}

.choice-pair {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}

.vs-divider {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.car-card {
  flex: 1;
  max-width: 260px;
  text-align: center;
  padding: 24px 20px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--card-bg);
  user-select: none;
}

.car-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
  transform: translateY(-2px);
}

.car-card.selected {
  border-color: var(--success);
  background: #f0fdf4;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
}

.car-card.not-selected {
  opacity: 0.4;
  transform: scale(0.97);
}

.car-card.example-card {
  cursor: default;
  max-width: 200px;
}

.car-card.example-card:hover {
  border-color: var(--border);
  box-shadow: none;
  transform: none;
}

.car-card-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.car-card-mileage {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.car-card-price {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.car-card-select {
  font-size: 12px;
  color: var(--text-secondary);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Car Brand Select
   ============================================================ */
.car-brand-select select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

/* ============================================================
   Completion
   ============================================================ */
.completion-box {
  text-align: center;
  padding: 20px 0;
}

.completion-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  font-size: 28px;
  color: #fff;
  background: var(--success);
  border-radius: 50%;
  margin: 0 auto 16px;
}

.completion-box h2 {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
  .page {
    margin: 20px auto;
    padding: 0 12px;
  }

  .card {
    padding: 20px;
  }

  .choice-pair {
    flex-direction: column;
    gap: 12px;
  }

  .vs-divider {
    font-size: 16px;
  }

  .car-card {
    max-width: 100%;
    width: 100%;
  }

  .car-card-mileage {
    font-size: 20px;
  }

  .car-card-price {
    font-size: 22px;
  }

  .input-group input[type="text"] {
    font-size: 20px;
    width: 160px;
  }
}
