/* ============================================================
   KBAYIA WEBAPP — Estilos compartidos
   Mobile-first | Paleta: azul marino + verde esmeralda + blanco
   ============================================================ */

:root {
  --primary:        #0A2342;
  --primary-mid:    #1A4F8A;
  --primary-light:  #E8F0FB;
  --accent:         #00C896;
  --accent-dark:    #00A07C;
  --accent-light:   #E0FAF4;
  --white:          #FFFFFF;
  --bg:             #F0F4F8;
  --card:           #FFFFFF;
  --border:         #CBD5E1;
  --border-focus:   #00C896;
  --text:           #1A202C;
  --text-muted:     #64748B;
  --error:          #E53E3E;
  --error-light:    #FFF5F5;
  --success:        #38A169;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow:         0 2px 12px rgba(10,35,66,0.10);
  --shadow-lg:      0 8px 32px rgba(10,35,66,0.16);
  --transition:     0.2s ease;
}

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

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ───────────────────────────────────────── */
.app-header {
  background: var(--primary);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.app-header img {
  height: 36px;
  width: auto;
}

.app-header .header-title {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
}

.app-header .header-sub {
  color: rgba(255,255,255,0.65);
  font-size: 0.75rem;
}

/* ── Progress bar ─────────────────────────────────── */
.progress-bar {
  background: rgba(255,255,255,0.15);
  height: 3px;
  position: absolute;
  bottom: 0; left: 0; right: 0;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.4s ease;
}

/* ── Step badge ───────────────────────────────────── */
.step-badge {
  background: var(--primary);
  color: var(--white);
  text-align: center;
  padding: 10px 20px 6px;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.step-badge span { color: var(--accent); font-weight: 700; }

/* ── Container ────────────────────────────────────── */
.container {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
}

/* ── Cards / Sections ─────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.section-header.static { cursor: default; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.section-icon {
  width: 32px;
  height: 32px;
  background: var(--primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: transform var(--transition);
}
.card.open .chevron { transform: rotate(180deg); }

.section-body {
  padding: 0 18px 18px;
  border-top: 1px solid var(--border);
}

.card.collapsed .section-body { display: none; }

/* ── Form fields ──────────────────────────────────── */
.field {
  margin-top: 14px;
}

.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.field label .required { color: var(--error); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0,200,150,0.15);
}

input.error,
select.error { border-color: var(--error); }

.field-error {
  color: var(--error);
  font-size: 0.78rem;
  margin-top: 4px;
  display: none;
}
.field-error.visible { display: block; }

select {
  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='%2364748B' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Toggle switch ────────────────────────────────── */
.toggle-group {
  display: flex;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  gap: 4px;
}

.toggle-group input[type="radio"] { display: none; }

.toggle-group label {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--transition);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.toggle-group input[type="radio"]:checked + label {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 2px 6px rgba(10,35,66,0.25);
}

/* ── Passenger counter ────────────────────────────── */
.counter-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.counter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.counter-label { font-size: 0.9rem; font-weight: 500; }
.counter-sublabel { font-size: 0.75rem; color: var(--text-muted); }

.counter-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.counter-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
}

.counter-btn:active { transform: scale(0.93); }
.counter-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.counter-btn.plus { border-color: var(--accent); color: var(--accent); }
.counter-btn.plus:hover { background: var(--accent); color: var(--white); }

.counter-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 24px;
  text-align: center;
}

/* ── Vehicle type cards ───────────────────────────── */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.vehicle-card input[type="radio"] { display: none; }

.vehicle-card label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
}

.vehicle-card label .v-icon { font-size: 1.6rem; }

.vehicle-card input[type="radio"]:checked + label {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--primary);
}

/* ── Mascota selector ─────────────────────────────── */
.pet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.pet-card input[type="radio"] { display: none; }

.pet-card label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  text-transform: none;
  letter-spacing: 0;
  margin: 0;
  transition: all var(--transition);
}

.pet-card label .p-icon { font-size: 1.4rem; }

.pet-card input[type="radio"]:checked + label {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--primary);
}

/* ── Phone prefix row ─────────────────────────────── */
.phone-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 8px;
}

/* ── Divider ──────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Passenger accordion ──────────────────────────── */
.passenger-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 12px;
  overflow: hidden;
}

.passenger-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--primary-light);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  -webkit-tap-highlight-color: transparent;
}

.passenger-header .pax-badge {
  background: var(--primary);
  color: var(--white);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 20px;
}

.passenger-body {
  padding: 14px;
}

.passenger-block.collapsed .passenger-body { display: none; }

/* ── Submit button ────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  margin-top: 8px;
}

.btn-submit:active { transform: scale(0.98); }
.btn-submit:hover  { background: var(--accent-dark); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-submit .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}

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

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

/* ── Success screen ───────────────────────────────── */
.success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  gap: 16px;
}

.success-screen.visible { display: flex; }

.success-icon {
  width: 72px;
  height: 72px;
  background: var(--accent-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
}

.success-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
}

.success-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 300px;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: var(--white);
  padding: 14px 28px;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  margin-top: 8px;
}

/* ── Info note ────────────────────────────────────── */
.info-note {
  background: var(--primary-light);
  border-left: 3px solid var(--primary-mid);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--primary);
  margin-top: 10px;
}

/* ── Pre-filled badge ─────────────────────────────── */
.prefilled-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  margin-bottom: 10px;
}

/* ── Error banner ─────────────────────────────────── */
.error-banner {
  background: var(--error-light);
  border: 1px solid var(--error);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 12px;
  display: none;
}
.error-banner.visible { display: block; }

/* ── Footer spacer ────────────────────────────────── */
.footer { height: 32px; }

/* ── Utility ──────────────────────────────────────── */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }

/* ── Responsive (tablet+) ─────────────────────────── */
@media (min-width: 540px) {
  .container { padding: 24px 16px; }
  .card { margin-bottom: 16px; }
}
