/* ===============================================================
   BOOKING FORM — booking-form.css
   Isuzu Migori | Smartlake Motors
   Design tokens mirror the main styles.css variables.
   =============================================================== */

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  --isuzu-red:       #EF0000;
  --isuzu-red-dark:  #B10000;
  --isuzu-black:     #1B1B1B;
  --isuzu-gray:      #6D6D6D;
  --isuzu-gray-lt:   #9E9E9E;
  --white:           #FFFFFF;
  --gray-50:         #FAFAFA;
  --gray-100:        #F5F5F5;
  --gray-200:        #EEEEEE;
  --gray-300:        #E0E0E0;
  --font-primary:    'IBM Plex Sans', sans-serif;
  --font-secondary:  'DM Sans', sans-serif;
  --shadow-md:       0 4px 12px rgba(0, 0, 0, 0.10);
  --shadow-lg:       0 10px 30px rgba(0, 0, 0, 0.15);
  --transition:      0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius:          10px;
}

/* ─── Base reset ─────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--isuzu-gray);
  background: var(--gray-100);
  min-width: 320px;
}

/* ─── Demo page wrapper ──────────────────────────────────────
   Used only for standalone preview. Remove .page-demo and its
   styles when embedding into index.html.
─────────────────────────────────────────────────────────────── */
.page-demo {
  min-height: 100vh;
  padding: 3rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ─── Section shell ──────────────────────────────────────────── */
.contact-section {
  width: 100%;
  max-width: 960px;
}

/* ─── Section heading ────────────────────────────────────────── */
.section-tag {
  display: inline-block;
  font-family: var(--font-primary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--isuzu-red);
  background: rgba(239, 0, 0, 0.08);
  padding: 0.35em 0.9em;
  border-radius: 2em;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-secondary);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--isuzu-black);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.section-sub {
  font-size: 0.95rem;
  color: var(--isuzu-gray);
  margin-bottom: 2.5rem;
}

/* ─── Form card ──────────────────────────────────────────────── */
.booking-card {
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Red accent bar at top of card */
.booking-card::before {
  content: '';
  display: block;
  height: 4px;
  background: var(--isuzu-red);
}

.booking-card-inner {
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.booking-card h3 {
  font-family: var(--font-secondary);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--isuzu-black);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.booking-card h3 svg {
  color: var(--isuzu-red);
  flex-shrink: 0;
}

/* ─── Form layout: grid rows ─────────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-row.single {
  grid-template-columns: 1fr;
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ─── Individual field group ─────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-family: var(--font-primary);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--isuzu-black);
  text-transform: uppercase;
}

/* Required field asterisk */
.form-group label .req {
  color: var(--isuzu-red);
  margin-left: 2px;
}

/* Input / select / textarea base styles */
.form-group input,
.form-group select,
.form-group textarea {
  font-family: var(--font-primary);
  font-size: 0.95rem;
  color: var(--isuzu-black);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 0.7em 0.9em;
  width: 100%;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
  appearance: none;
  -webkit-appearance: none;
}

/* Custom dropdown arrow wrapper */
.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '';
  position: absolute;
  right: 0.9em;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--isuzu-gray);
  pointer-events: none;
}

/* Focus state */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--isuzu-red);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(239, 0, 0, 0.10);
}

/* Disabled state */
.form-group input:disabled,
.form-group select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Helper text below field */
.form-group .field-hint {
  font-size: 0.75rem;
  color: var(--isuzu-gray-lt);
  margin-top: 0.15rem;
}

/* ─── Validation: error state ────────────────────────────────
   Added/removed by booking-form.js via classList.toggle()
─────────────────────────────────────────────────────────────── */
.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--isuzu-red);
  background: rgba(239, 0, 0, 0.03);
}

.form-group .error-msg {
  display: none;
  font-size: 0.75rem;
  color: var(--isuzu-red);
  font-weight: 500;
}

.form-group.has-error .error-msg {
  display: block;
}

/* ─── Submit button ──────────────────────────────────────────── */
.btn-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.85em 1.5em;
  margin-top: 0.5rem;
  background: var(--isuzu-red);
  color: var(--white);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    background var(--transition),
    transform var(--transition),
    box-shadow var(--transition);
}

.btn-submit:hover {
  background: var(--isuzu-red-dark);
  box-shadow: 0 4px 16px rgba(239, 0, 0, 0.35);
}

.btn-submit:active {
  transform: scale(0.99);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Loading spinner (shown when .loading class is added by JS) */
.btn-submit .spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-submit.loading .spinner {
  display: block;
}

.btn-submit.loading .btn-label {
  opacity: 0.7;
}

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

/* ─── Form status message ────────────────────────────────────── */
.form-status {
  margin-top: 1rem;
  padding: 0.75em 1em;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  display: none;
}

.form-status.success {
  display: block;
  background: rgba(0, 160, 80, 0.08);
  color: #00703c;
  border: 1px solid rgba(0, 160, 80, 0.2);
}

.form-status.error {
  display: block;
  background: rgba(239, 0, 0, 0.07);
  color: var(--isuzu-red-dark);
  border: 1px solid rgba(239, 0, 0, 0.18);
}

/* ─── Internal form divider ──────────────────────────────────── */
.form-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 1.5rem 0;
}

/* ─── Sub-section label inside form ─────────────────────────── */
.form-section-label {
  font-family: var(--font-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--isuzu-gray-lt);
  margin-bottom: 1rem;
}