/* ============================================================
   Vehicle Registration Form — Styles
   Palette: Tracking Blue (#2563EB) + Delivery Orange (#F97316)
   Font: Inter
   ============================================================ */

:root {
  --primary: #2563EB;
  --primary-dark: #1E40AF;
  --primary-light: #3B82F6;
  --accent: #F97316;
  --accent-dark: #EA580C;
  --bg: #EFF6FF;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #475569;
  --border: #E2E8F0;
  --ring: rgba(37, 99, 235, 0.35);
  --success: #16A34A;
  --error: #DC2626;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 50px -20px rgba(15, 23, 42, 0.28);
  --radius: 16px;
  --radius-lg: 22px;
  --container: 720px;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  z-index: 200;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: color var(--transition), background var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform var(--transition);
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn:active { transform: translateY(0); }
.btn-lg { padding: 16px 28px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn-cta {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px -10px rgba(249, 115, 22, 0.55);
}
.btn-cta:hover {
  background: var(--accent-dark);
  box-shadow: 0 16px 30px -10px rgba(234, 88, 12, 0.6);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 12px 24px -12px rgba(37, 99, 235, 0.6);
}
.btn-primary:hover { background: var(--primary-dark); }

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 100;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-md); }
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 12px;
  max-width: calc(var(--container) + 120px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  flex-shrink: 0;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.brand-text .accent { color: var(--accent); }
.brand-text small { font-size: .72rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }

.phone-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--primary-dark);
  cursor: pointer;
  transition: color var(--transition);
}
.phone-link svg { width: 18px; height: 18px; }
.phone-link:hover { color: var(--accent-dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 150px 0 90px;
  background: linear-gradient(180deg, #DBEAFE 0%, var(--bg) 100%);
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.hero-shape { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; }
.shape-1 { width: 460px; height: 460px; background: #BFDBFE; top: -160px; right: -130px; }
.shape-2 { width: 380px; height: 380px; background: #FED7AA; bottom: -180px; left: -120px; }

.hero-head {
  max-width: 620px;
  margin: 0 auto 40px;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-dark);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--success);
  animation: pulse-dot 1.8s ease-out infinite;
}
@keyframes pulse-dot {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

.hero-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 16px;
}
.hero-head p { font-size: 1.1rem; color: var(--muted); }

/* ---------- Form card ---------- */
.form-wrap { position: relative; }
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  border: 1px solid var(--border);
  scroll-margin-top: 110px;
}
.form-card-head { margin-bottom: 26px; }
.form-card-head h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.form-card-head p { color: var(--muted); font-size: .92rem; }
.req-mark { color: var(--accent-dark); font-weight: 800; }

/* ---------- Fields ---------- */
.register-form { display: flex; flex-direction: column; gap: 26px; }

fieldset { border: none; display: flex; flex-direction: column; gap: 16px; }
legend {
  font-size: .85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--primary-dark);
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 4px;
  width: 100%;
}

.field { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.field-row { display: flex; gap: 14px; }
.field-year { max-width: 110px; }
.field-city { flex: 1.6; }
.field-state { max-width: 130px; }
.field-zip { max-width: 120px; }

.field label { font-size: .8rem; font-weight: 700; }
.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.field input::placeholder,
.field textarea::placeholder { color: #94A3B8; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
  background: #fff;
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}
textarea { resize: vertical; }

.error-msg {
  font-size: .78rem;
  font-weight: 600;
  color: var(--error);
  min-height: 15px;
  line-height: 15px;
}

.form-status { font-size: .95rem; font-weight: 600; text-align: center; min-height: 22px; }
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#submitBtn.loading .btn-label { opacity: .6; }
#submitBtn.loading .btn-spinner { display: block; }
#submitBtn.loading { cursor: wait; }

/* ---------- Second vehicle ---------- */
.btn-add-vehicle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  font-weight: 700;
  font-size: .92rem;
  color: var(--primary-dark);
  background: transparent;
  border: 2px dashed var(--primary-light);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.btn-add-vehicle:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-add-vehicle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.btn-add-vehicle svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-add-vehicle.hidden-add { display: none; }

.vehicle-2 {
  background: #F8FAFC;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.vehicle-2[hidden] { display: none; }
.vehicle-2 legend { margin-bottom: 4px; }
.vehicle-2 .optional { color: var(--muted); font-weight: 600; text-transform: none; letter-spacing: normal; }

.remove-vehicle {
  align-self: flex-start;
  background: none;
  border: none;
  padding: 0;
  color: var(--error);
  font-weight: 600;
  font-size: .85rem;
  cursor: pointer;
  transition: color var(--transition);
}
.remove-vehicle:hover { color: var(--accent-dark); text-decoration: underline; }
.remove-vehicle:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Confirmation modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--transition), visibility 300ms var(--transition);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px 32px;
  text-align: center;
  transform: translateY(16px) scale(0.97);
  transition: transform 300ms var(--transition);
}
.modal-backdrop.open .modal { transform: none; }
.modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.12);
  color: var(--success);
  margin-bottom: 20px;
}
.modal-icon svg { width: 38px; height: 38px; }
.modal h3 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}
.modal p { color: var(--muted); font-size: .95rem; margin-bottom: 26px; }
.modal .btn { min-width: 160px; }

/* ---------- Trust + footer ---------- */
.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  list-style: none;
}
.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}
.trust-list svg { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

.form-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: .8rem;
  color: var(--muted);
  justify-content: center;
}
.form-note svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; color: var(--success); }

.footer { background: #0F172A; color: #94A3B8; padding: 28px 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: .82rem;
}
.footer a { color: #CBD5E1; font-weight: 600; cursor: pointer; transition: color var(--transition); }
.footer a:hover { color: var(--accent); }

/* ---------- Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s cubic-bezier(0.4, 0, 0.2, 1),
              transform .7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.in-view { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .field-row { flex-direction: column; gap: 14px; }
  .field-year,
  .field-state,
  .field-zip,
  .field-city { max-width: none; }
  .form-card { padding: 26px 20px; }
  .phone-link { display: none; }
  .container { padding-inline: 16px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}