/* ============================================================
   ROADSET — Appointment Page Stylesheet
   ============================================================ */

/* ── Page Base ──────────────────────────────────────────────── */
body.appt-page {
  font-family: 'Barlow', system-ui, sans-serif;
  background: #f1f5f9;
  color: var(--dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Utility ────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Header ─────────────────────────────────────────────────── */
.appt-header {
  background: var(--blue);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.appt-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.appt-header .logo-link {
  display: flex;
  align-items: center;
}

.appt-header .logo-img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.appt-header .logo-link:hover .logo-img {
  opacity: 0.88;
  transform: translateY(-1px);
}

.appt-header .nav-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--red);
  color: var(--white);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.22s ease, box-shadow 0.22s ease;
}

.appt-header .nav-phone:hover {
  background: var(--red-dark);
  box-shadow: 0 3px 12px rgba(204,27,42,0.4);
}

/* ── Main Container ─────────────────────────────────────────── */
.appt-main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

/* ── Page Title ─────────────────────────────────────────────── */
.appt-page-title {
  text-align: center;
  padding: 40px 0 24px;
}

.appt-page-title h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 10px;
}

.appt-page-title p {
  font-size: 1rem;
  color: var(--gray);
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-wrap {
  position: sticky;
  top: 72px;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--gray-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 16px 24px;
  margin: 0 -20px 24px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  max-width: 400px;
  margin: 0 auto;
}

.prog-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.prog-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: var(--gray-light);
  color: var(--gray);
  transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.prog-step span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray);
  transition: color 0.3s ease;
}

.prog-step.active .prog-num {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(27,61,140,0.15);
}

.prog-step.active span {
  color: var(--blue);
}

.prog-step.done .prog-num {
  background: #16a34a;
  color: var(--white);
  font-size: 0;
  position: relative;
}

.prog-step.done .prog-num::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.85rem;
  color: var(--white);
}

.prog-step.done span {
  color: #16a34a;
}

.prog-line {
  flex: 1;
  height: 2px;
  background: var(--gray-light);
  margin: 0 8px;
  margin-bottom: 22px;
  transition: background 0.3s ease;
  min-width: 40px;
}

.prog-line.done {
  background: #16a34a;
}

/* ── Appointment Card ───────────────────────────────────────── */
.appt-card {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

/* ── Step Titles ────────────────────────────────────────────── */
.step-title {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 6px;
}

.step-subtitle {
  font-size: 0.95rem;
  color: var(--gray);
  margin-bottom: 28px;
}

/* ── Tab Switcher ───────────────────────────────────────────── */
.tab-switcher {
  display: flex;
  background: var(--gray-light);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--gray);
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.6);
  color: var(--dark);
}

.tab-btn.active {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(27,61,140,0.25);
}

/* ── VIN Input ──────────────────────────────────────────────── */
.vin-input-wrap {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.vin-input-wrap input {
  flex: 1;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--light);
  border: 1.5px solid var(--gray-light);
  border-radius: 8px;
  padding: 11px 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  outline: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vin-input-wrap input:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,61,140,0.10);
}

.vin-decode-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 20px;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.22s ease, box-shadow 0.22s ease, transform 0.1s ease;
  flex-shrink: 0;
}

.vin-decode-btn:hover {
  background: var(--blue-dark);
  box-shadow: 0 3px 12px rgba(27,61,140,0.3);
}

.vin-decode-btn:active {
  transform: scale(0.97);
}

.vin-decode-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.vin-decode-btn .fa-spinner {
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── VIN Help ───────────────────────────────────────────────── */
.vin-help-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  transition: color 0.22s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
}

.vin-help-trigger:hover {
  color: var(--blue-dark);
  text-decoration-color: var(--blue-dark);
}

.vin-help-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.vin-help-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.vin-help-item > i {
  font-size: 1rem;
  color: var(--blue);
  margin-top: 3px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.vin-help-item div strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 2px;
}

.vin-help-item div p {
  font-size: 0.82rem;
  color: var(--gray);
  margin: 0;
  line-height: 1.5;
}

/* ── Decoded Badge ──────────────────────────────────────────── */
.decoded-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  color: #16a34a;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 12px;
  margin-bottom: 4px;
}

.decoded-badge i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Battery Result ─────────────────────────────────────────── */
#batteryResult {
  margin-top: 16px;
}

.battery-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1.5px solid var(--gray-light);
  border-left-width: 5px;
  background: var(--white);
}

.battery-card.found {
  border-left-color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
  border-left-color: #16a34a;
}

.battery-card.ev {
  border-left-color: var(--blue);
  background: #eff6ff;
  border-color: #bfdbfe;
  border-left-color: var(--blue);
}

.battery-card.unknown {
  border-left-color: var(--gray);
  background: #f8fafc;
  border-color: var(--gray-light);
  border-left-color: var(--gray);
}

.battery-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.battery-card.found .battery-card-icon {
  background: #dcfce7;
  color: #16a34a;
}

.battery-card.ev .battery-card-icon {
  background: #dbeafe;
  color: var(--blue);
}

.battery-card.unknown .battery-card-icon {
  background: var(--gray-light);
  color: var(--gray);
}

.battery-card-content {
  flex: 1;
}

.battery-card-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.battery-card.found .battery-card-label { color: #16a34a; }
.battery-card.ev .battery-card-label { color: var(--blue); }
.battery-card.unknown .battery-card-label { color: var(--gray); }

.battery-card-group {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--dark);
  line-height: 1.2;
}

.battery-card-note {
  font-size: 0.82rem;
  color: var(--gray);
  margin-top: 4px;
}

/* ── Form Groups ────────────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row.two-col > * { flex: 1; min-width: 0; }
.form-row.three-col > * { flex: 1; min-width: 0; }

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark-2);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.req { color: var(--red); }

.form-group input,
.form-group select,
.form-group textarea {
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--dark);
  background: var(--light);
  border: 1.5px solid var(--gray-light);
  border-radius: 8px;
  padding: 11px 14px;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  outline: none;
  width: 100%;
}

.form-group select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(27,61,140,0.10);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(204,27,42,0.10);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--gray);
  margin-top: 4px;
  min-height: 1.2em;
}

.field-hint.error { color: var(--red); }
.field-hint.success { color: #16a34a; }

/* ── Soft Warning ───────────────────────────────────────────── */
.soft-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  color: #854d0e;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 8px;
}

.soft-warning i {
  font-size: 0.95rem;
  flex-shrink: 0;
  color: #ca8a04;
}

/* ── Step Actions ───────────────────────────────────────────── */
.step-actions {
  margin-top: 28px;
  display: flex;
  justify-content: flex-end;
}

.step-actions.two-btns {
  justify-content: space-between;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: transparent;
  color: var(--gray);
  border: 2px solid var(--gray-light);
  border-radius: 8px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
  text-decoration: none;
}

.btn-back:hover {
  background: var(--gray-light);
  color: var(--dark);
  border-color: #d1d5db;
}

.btn-next,
.btn.btn-primary.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: 8px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn-next:hover,
.btn.btn-primary.btn-next:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 4px 16px rgba(204,27,42,0.35);
}

.btn-next:active { transform: scale(0.97); }

.btn-next:disabled,
.btn.btn-primary.btn-next:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Confirm Button ─────────────────────────────────────────── */
.confirm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--red);
  color: var(--white);
  border: 2px solid var(--red);
  border-radius: 8px;
  font-family: 'Barlow', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
  flex: 1;
}

.confirm-btn:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
  box-shadow: 0 4px 16px rgba(204,27,42,0.35);
}

.confirm-btn:active { transform: scale(0.97); }

.confirm-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}

.confirm-btn .fa-spinner {
  animation: spin 0.8s linear infinite;
}

/* ── Review Table ───────────────────────────────────────────── */
.review-table {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--gray-light);
  margin-bottom: 8px;
}

.review-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--gray-light);
}

.review-row:last-child {
  border-bottom: none;
}

.review-row:nth-child(even) {
  background: #f8fafc;
}

.review-row:nth-child(odd) {
  background: var(--white);
}

.review-label {
  font-weight: 700;
  color: var(--gray);
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 1px;
}

.review-value {
  color: var(--dark);
  font-weight: 600;
  word-break: break-word;
}

/* ── Success Screen ─────────────────────────────────────────── */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
}

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(22,163,74,0.3);
}

.success-icon i {
  font-size: 2rem;
  color: var(--white);
}

.success-screen h2 {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--dark);
  margin-bottom: 12px;
}

.success-msg {
  font-size: 1rem;
  color: var(--gray);
  max-width: 460px;
  margin-bottom: 20px;
  line-height: 1.65;
}

.success-note {
  font-size: 0.9rem;
  color: var(--dark-2);
  font-weight: 600;
  margin-bottom: 8px;
}

.back-home-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  transition: color 0.22s ease;
}

.back-home-link:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}

/* ── Footer ─────────────────────────────────────────────────── */
.appt-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.82rem;
}

.appt-footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.22s ease;
}

.appt-footer a:hover {
  color: var(--white);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .appt-main {
    padding: 0 14px 48px;
  }

  .appt-card {
    padding: 22px 18px;
    border-radius: 12px;
  }

  .appt-page-title {
    padding: 28px 0 16px;
  }

  .appt-page-title h1 {
    font-size: 1.5rem;
  }

  .progress-wrap {
    padding: 14px 16px;
    margin: 0 -14px 20px;
  }

  .prog-num {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .prog-step span {
    font-size: 0.65rem;
  }

  .prog-line {
    min-width: 24px;
    margin: 0 4px;
    margin-bottom: 20px;
  }

  .form-row.two-col,
  .form-row.three-col {
    flex-direction: column;
    gap: 0;
  }

  .vin-input-wrap {
    flex-direction: column;
  }

  .vin-decode-btn {
    justify-content: center;
  }

  .step-actions.two-btns {
    flex-direction: column-reverse;
  }

  .btn-back,
  .confirm-btn,
  .btn-next,
  .btn.btn-primary.btn-next {
    width: 100%;
    justify-content: center;
  }

  .review-label {
    min-width: 110px;
  }

  .tab-btn {
    font-size: 0.82rem;
    padding: 9px 10px;
  }

  .step-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 400px) {
  .appt-header .nav-phone {
    font-size: 0.9rem;
    padding: 8px 12px;
  }

  .appt-header .logo-img {
    height: 42px;
  }
}
