/* MSD Mobile Car Wash — mobile-first styles */

:root {
  --background: #f0f6ff;
  --foreground: #0f172a;
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --muted: #64748b;
  --border: #bfdbfe;
  --card: #ffffff;
  --success: #059669;
  --font: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: 6rem;
}

::selection { background: var(--primary); color: #fff; }

/* Header */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

.site-header-inner { max-width: 32rem; margin: 0 auto; }

.logo-badge {
  width: 4rem; height: 4rem;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15);
  border-radius: 1rem;
  backdrop-filter: blur(4px);
}

.logo-badge.small { width: 2.5rem; height: 2.5rem; margin: 0; border-radius: 0.75rem; }

.site-header h1 { margin: 0; font-size: 1.5rem; font-weight: 700; }
.site-header p { margin: 0.5rem 0 0; font-size: 0.875rem; color: #bfdbfe; }

.legal-header {
  background: var(--primary);
  color: #fff;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
}

.legal-header-inner { max-width: 56.25rem; margin: 0 auto; }

.legal-header-brand { display: flex; align-items: center; gap: 0.75rem; }

.legal-header-title { margin: 0; font-size: 0.875rem; font-weight: 500; color: #bfdbfe; }
.legal-header-sub { margin: 0; font-size: 0.75rem; color: #93c5fd; }

/* Layout */
.main-wrap { max-width: 32rem; margin: 0 auto; padding: 1.5rem 1rem; }
.legal-wrap { max-width: 56.25rem; margin: 0 auto; padding: 2rem 1rem; }

.card {
  background: var(--card);
  border-radius: 1rem;
  box-shadow: 0 4px 24px rgba(30,64,175,0.08), 0 1px 3px rgba(0,0,0,0.04);
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .card { padding: 2rem; border-radius: 1rem; }
  .site-header { padding: 2.5rem 1.5rem; }
  .site-header h1 { font-size: 1.875rem; }
  .main-wrap { padding: 2rem 1.5rem; }
}

/* Progress */
.progress-wrap {
  margin-bottom: 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--card);
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

@media (min-width: 640px) {
  .progress-wrap { margin-left: -2rem; margin-right: -2rem; padding: 1rem 2rem; }
}

.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 0.75rem; font-weight: 500; color: var(--muted);
  margin-bottom: 0.75rem;
}

.progress-bar { display: flex; align-items: center; gap: 0.25rem; }

.progress-step {
  display: flex; flex: 1; align-items: center;
}

.step-circle {
  width: 2rem; height: 2rem; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  border: 1px solid var(--border);
  background: #fff; color: var(--muted);
  transition: all 0.2s;
}

.step-circle.active { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(30,64,175,0.2); border-color: var(--primary); }
.step-circle.done { background: var(--primary); color: #fff; border-color: var(--primary); }

.step-line { flex: 1; height: 2px; margin: 0 0.25rem; background: var(--border); border-radius: 1px; }
.step-line.done { background: var(--primary); }

.progress-subtitle { text-align: center; font-size: 0.875rem; color: var(--muted); margin: 0.75rem 0 0; }

/* Form */
.step-panel { display: none; }
.step-panel.active { display: block; }

.step-title { font-size: 1.25rem; font-weight: 700; color: var(--primary); margin: 0 0 1.25rem; }

.field { margin-bottom: 1.25rem; }
.field label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 500; }
.field label .req { color: var(--primary); }

.input, .select, .textarea {
  width: 100%; min-height: 3.25rem;
  padding: 0.75rem 1rem;
  font-size: 1rem; font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff; color: var(--foreground);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.textarea { min-height: 5.5rem; resize: vertical; }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(30,64,175,0.2);
}

.input.uppercase { text-transform: uppercase; }

.field-error { margin: 0.25rem 0 0; font-size: 0.75rem; color: #dc2626; }
.field-hint { margin: 0.25rem 0 0; font-size: 0.75rem; color: var(--muted); }

/* Package cards */
.package-list { display: flex; flex-direction: column; gap: 0.75rem; }

.package-card {
  width: 100%; text-align: left;
  padding: 1.25rem;
  border: 2px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.package-card:hover { border-color: rgba(30,64,175,0.4); }
.package-card.selected { border-color: var(--primary); background: rgba(30,64,175,0.05); box-shadow: 0 0 0 2px rgba(30,64,175,0.2); }

.package-card-inner { display: flex; justify-content: space-between; gap: 0.75rem; }
.package-card h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.package-card p { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); }
.package-price { font-size: 1.125rem; font-weight: 700; color: var(--primary); white-space: nowrap; }
.package-price span { font-size: 0.875rem; font-weight: 400; color: var(--muted); }

.fee-box {
  text-align: center;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(30,64,175,0.05);
  border: 1px solid rgba(30,64,175,0.2);
}

.fee-box p { margin: 0; font-size: 0.875rem; color: var(--muted); }
.fee-box strong { display: block; margin-top: 0.25rem; font-size: 1.5rem; color: var(--primary); }

/* Review */
.review-box {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--background);
  padding: 1rem;
  font-size: 0.875rem;
}

.review-row { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.5rem; }
.review-row:last-child { margin-bottom: 0; }
.review-row.border-top { border-top: 1px solid var(--border); padding-top: 0.5rem; margin-top: 0.5rem; }
.review-row .muted { color: var(--muted); }
.review-row .bold { font-weight: 700; color: var(--primary); }

/* Checkboxes */
.checkbox-group { display: flex; flex-direction: column; gap: 1rem; padding: 1rem; border: 1px solid var(--border); border-radius: 0.75rem; background: #fff; }

.checkbox-label {
  display: flex; align-items: flex-start; gap: 0.75rem;
  font-size: 0.875rem; line-height: 1.5; cursor: pointer;
}

.checkbox-label input { width: 1.25rem; height: 1.25rem; margin-top: 0.125rem; flex-shrink: 0; accent-color: var(--primary); }

.checkbox-label a { font-weight: 600; color: var(--primary); }

/* Buttons */
.btn-row { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 2rem; }

@media (min-width: 640px) {
  .btn-row { flex-direction: row; }
  .btn-row .btn-grow { flex: 1; }
  .btn-row .btn-back { min-width: 8.75rem; width: auto; }
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.25rem; width: 100%;
  padding: 0.75rem 1.5rem;
  font-size: 1rem; font-weight: 600; font-family: inherit;
  border-radius: 0.75rem;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary { background: #fff; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: rgba(30,64,175,0.05); }

.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }

.alert-error {
  padding: 1rem;
  border-radius: 0.75rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.875rem;
}

/* Overlay */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}

.spinner {
  width: 3rem; height: 3rem;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* Success page */
.success-card { animation: success-pop 0.5s ease-out forwards; }

@keyframes success-pop {
  from { opacity: 0; transform: translateY(1rem); }
  to { opacity: 1; transform: translateY(0); }
}

.success-icon {
  width: 5rem; height: 5rem;
  margin: 0 auto 1rem;
  display: flex; align-items: center; justify-content: center;
  background: #d1fae5;
  border-radius: 50%;
  animation: icon-pop 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

@keyframes icon-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.success-title { text-align: center; font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.success-sub { text-align: center; color: var(--muted); margin: 0.5rem 0 0; }

.highlight-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  text-align: center;
  border-radius: 0.75rem;
  background: rgba(30,64,175,0.05);
  border: 1px solid rgba(30,64,175,0.2);
}

.highlight-box .label { font-size: 0.875rem; font-weight: 500; color: var(--muted); margin: 0; }
.highlight-box .value { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0.25rem 0 0; letter-spacing: 0.05em; }

.info-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: #fff;
}

.info-box h3 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--primary); }

.payment-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 2px solid rgba(30,64,175,0.3);
  border-radius: 0.75rem;
  background: #eff6ff;
}

.payment-box h3 { margin: 0 0 1rem; color: var(--primary); }

.payment-row { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; font-size: 0.875rem; }
.payment-row .muted { color: var(--muted); }
.payment-row.border-top { border-top: 1px solid rgba(30,64,175,0.2); padding-top: 0.75rem; margin-top: 0.75rem; }

.copy-btn {
  background: none; border: none; color: var(--primary); cursor: pointer; padding: 0;
}

/* Legal pages */
.legal-page { background: #fff; }
.legal-document { color: var(--foreground); }

.legal-doc-header { text-align: center; margin-bottom: 2.5rem; }
.legal-doc-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0; }
.legal-doc-header h2 { font-size: 1.125rem; font-weight: 600; margin: 0.75rem 0 0; }
.legal-meta { font-size: 0.875rem; color: var(--muted); margin: 0.25rem 0 0; }

.legal-paragraph {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: justify;
}

@media (min-width: 640px) { .legal-paragraph { font-size: 1rem; } }

.legal-clause { border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.legal-clause:last-child { border-bottom: none; }
.legal-clause h3 { font-size: 1rem; font-weight: 700; color: var(--primary); margin: 0 0 0.75rem; }

.cpa-notice-box {
  border: 2px solid #fcd34d;
  background: #fffbeb;
  border-radius: 1rem;
  padding: 1.25rem;
  color: #78350f;
}

@media (min-width: 640px) { .cpa-notice-box { padding: 2rem; } }

.cpa-notice-box h2 { font-size: 1.125rem; font-weight: 700; color: #78350f; margin: 0 0 1rem; }
.cpa-notice-box h3 { font-size: 1rem; font-weight: 700; color: #78350f; margin: 1.5rem 0 0.75rem; }
.cpa-notice-box p { font-size: 0.875rem; line-height: 1.6; margin: 0 0 1rem; }
.cpa-clause { margin-bottom: 1rem; }
.cpa-clause-title { font-weight: 600; margin: 0 0 0.25rem; }
.cpa-list { margin: 0; padding-left: 1.25rem; font-size: 0.875rem; line-height: 1.6; }
.cpa-list li { margin-bottom: 0.5rem; }

.legal-section { margin-top: 2rem; }
.legal-section h2 { font-size: 1.125rem; font-weight: 700; color: var(--primary); margin: 0 0 1rem; }

.purpose-grid { display: flex; flex-direction: column; gap: 1rem; }
.purpose-card { border: 1px solid var(--border); border-radius: 0.75rem; background: var(--background); padding: 1rem; }
.purpose-card h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.purpose-card p { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--muted); line-height: 1.5; }

.legal-list { margin: 0; padding-left: 1.25rem; }
.legal-list li { margin-bottom: 0.5rem; font-size: 0.875rem; line-height: 1.6; text-align: justify; }

.operator-box {
  margin-top: 2rem;
  padding: 1.25rem;
  border: 1px solid rgba(30,64,175,0.2);
  border-radius: 0.75rem;
  background: rgba(30,64,175,0.05);
}

.operator-box h2 { font-size: 1.125rem; font-weight: 700; color: var(--primary); margin: 0 0 1rem; }
.operator-box dl { margin: 0; font-size: 0.875rem; }
.operator-box dt { font-weight: 600; margin-top: 0.5rem; }
.operator-box dt:first-child { margin-top: 0; }
.operator-box dd { margin: 0.125rem 0 0; color: var(--muted); }
.operator-box a { color: var(--primary); }

.legal-back { margin-top: 2.5rem; text-align: center; }
.legal-back .btn { max-width: 18rem; margin: 0 auto; }

/* WhatsApp FAB */
.whatsapp-fab {
  position: fixed;
  bottom: 1.25rem; right: 1.25rem;
  z-index: 50;
  width: 3.5rem; height: 3.5rem;
  display: flex; align-items: center; justify-content: center;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  text-decoration: none;
  transition: transform 0.2s;
}

.whatsapp-fab:hover { transform: scale(1.05); }

@media print {
  .whatsapp-fab, .legal-back, .progress-wrap { display: none !important; }
  .cpa-notice-box { background: #fffbeb !important; border: 2px solid #d97706 !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .success-card, .success-icon, .spinner { animation: none; }
}
