/* ════════════════════════════════════════════════════════════════════════════
 * cita-styles.css — Segimon Automoció (cita.segimonautomocio.com)
 *
 * Sistema basado en Cal.com — "Monochrome Utility, Human Touch":
 *   - Paleta monocroma estricta (Ink, Graphite, Slate, Paper, White)
 *   - Verde Segimon (#06A600) como ÚNICO acento de marca (CTAs, enlaces, activos)
 *   - Tipografía Inter (single family) — sin Cal Sans propietaria
 *   - Pills (radius 9999px) para botones primarios/secundarios
 *   - Cards con sombras suaves, SIN bordes
 *   - Density compact
 *
 * Las clases existentes se mantienen para no romper las páginas; los estilos
 * se han reescrito según el sistema de diseño.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Fuente Inter de Google Fonts. Variable font para tamaños cargados solo una vez. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* ── Sistema cal.com — Paleta monocroma ─────────────────────────────────── */
  --color-ink:        #101010;  /* CTAs primarios, texto enfático, dark mode */
  --color-graphite:   #242424;  /* Headings, texto principal */
  --color-slate:      #6b7280;  /* Texto secundario, descripciones */
  --color-stone:      #898989;  /* Placeholders, UI decorativa */
  --color-silver:     #e5e7eb;  /* Bordes, separadores, fondos sutiles */
  --color-paper:      #f4f4f4;  /* Fondo de página */
  --color-white:      #ffffff;  /* Fondo de cards, texto sobre dark */
  --color-action-blue:#0099ff;  /* Enlaces secundarios (uso restringido) */
  --color-info-bg:    #eff6fe;  /* Fondo banner info */

  /* ── Verde Segimon — ÚNICO acento de marca ──────────────────────────────── */
  --color-brand:      #06A600;  /* Verde corporativo Segimon */
  --color-brand-dk:   #058A00;  /* Hover/active del verde */
  --color-brand-lt:   #e6f6e6;  /* Fondo sutil (badges, banners verdes) */
  --color-brand-tint: #f4faf4;  /* Tinte muy suave */

  /* ── Estado (rojo/ámbar) — Uso parsimónico para errores/avisos ─────────── */
  --color-danger:     #dc2626;
  --color-danger-bg:  #fef2f2;
  --color-warn:       #d97706;
  --color-warn-bg:    #fef3c7;

  /* ── Tipografía — Inter como única familia (no Cal Sans propietaria) ────── */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Heading font = Inter pero con tracking ligero positivo (imita Cal Sans) */
  --font-heading: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;

  /* ── Type scale (cal.com) ───────────────────────────────────────────────── */
  --text-caption:     12px;   --leading-caption: 1.4;     --tracking-caption: -0.24px;
  --text-body-sm:     14px;   --leading-body-sm: 1.5;     --tracking-body-sm: -0.2px;
  --text-body:        16px;   --leading-body:    1.5;     --tracking-body:    -0.19px;
  --text-subheading:  18px;   --leading-subhead: 1.4;     --tracking-subhead: -0.2px;
  --text-heading-sm:  20px;   --leading-h-sm:    1.3;     --tracking-h-sm:    0.2px;
  --text-heading:     24px;   --leading-h:       1.3;     --tracking-h:       0.24px;
  --text-heading-lg:  36px;   --leading-h-lg:    1.15;    --tracking-h-lg:    0.36px;
  --text-display:     48px;   --leading-display: 1.1;     --tracking-display: 0.48px;

  /* ── Spacing scale ──────────────────────────────────────────────────────── */
  --space-4: 4px;   --space-6: 6px;    --space-8: 8px;    --space-10: 10px;
  --space-12: 12px; --space-16: 16px;  --space-20: 20px;  --space-24: 24px;
  --space-28: 28px; --space-32: 32px;  --space-40: 40px;  --space-48: 48px;
  --space-64: 64px; --space-80: 80px;

  /* ── Radii ──────────────────────────────────────────────────────────────── */
  --radius-input:  8px;    /* Inputs, textareas, selects, ghost btns rectangulares */
  --radius-card:  12px;    /* Cards, modales, contenedores grandes */
  --radius-tag:   9999px;  /* Tags, pills, badges */
  --radius-pill:  9999px;  /* CTAs primary/secondary */

  /* ── Shadows ────────────────────────────────────────────────────────────── */
  --shadow-card:  rgba(34, 42, 53, 0.05) 0px 4px 8px 0px;
  --shadow-hover: rgba(36, 36, 36, 0.7) 0px 1px 5px -4px, rgba(36, 36, 36, 0.05) 0px 4px 8px 0px;
  --shadow-input: 0 0 0 3px rgba(6, 166, 0, 0.12);  /* focus ring usando verde marca */

  /* ── Layout ─────────────────────────────────────────────────────────────── */
  --page-max:   1200px;
  --wrap-narrow:720px;  /* contenedor estrecho para formularios */
  --card-pad:   24px;

  /* ── Legacy compat (mientras quedan estilos inline en HTML) ─────────────── */
  --green:     var(--color-brand);
  --green-dk:  var(--color-brand-dk);
  --green-lt:  var(--color-brand-lt);
  --text:      var(--color-graphite);
  --text2:     var(--color-slate);
  --text3:     var(--color-stone);
  --bg:        var(--color-paper);
  --panel:     var(--color-white);
  --border:    var(--color-silver);
  --red:       var(--color-danger);
  --amber:     var(--color-warn);
  --r:         var(--radius-card);
  --r-input:   var(--radius-input);
  --shadow:    var(--shadow-card);
  --shadow-lg: var(--shadow-hover);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESET BASE                                                                  */
/* ─────────────────────────────────────────────────────────────────────────── */

*,*::before,*::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--color-paper);
  color: var(--color-graphite);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 300;            /* Light por defecto, según cal.com body */
  line-height: var(--leading-body);
  letter-spacing: var(--tracking-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings: Inter 600 + tracking ligero, imita la voz "geométrica abierta" de Cal Sans */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-graphite);
  margin: 0;
  letter-spacing: 0.2px;
}
h1 { font-size: var(--text-heading-lg); line-height: var(--leading-h-lg); letter-spacing: var(--tracking-h-lg); }
h2 { font-size: var(--text-heading);    line-height: var(--leading-h);    letter-spacing: var(--tracking-h); }
h3 { font-size: var(--text-heading-sm); line-height: var(--leading-h-sm); letter-spacing: var(--tracking-h-sm); }
h4 { font-size: var(--text-subheading); line-height: var(--leading-subhead); letter-spacing: var(--tracking-subhead); }

p { margin: 0 0 var(--space-12); }
a { color: var(--color-brand); text-decoration: none; transition: color 0.15s ease, opacity 0.15s ease; }
a:hover { color: var(--color-brand-dk); text-decoration: none; }
a:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; border-radius: 4px; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* LAYOUT — wrappers                                                          */
/* ─────────────────────────────────────────────────────────────────────────── */

.wrap         { max-width: var(--page-max);    margin: 0 auto; padding: 0 var(--space-20); }
.wrap-narrow  { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 var(--space-20); }

/* Hero (sección titular debajo del header) */
.hero {
  text-align: center;
  padding: var(--space-48) var(--space-20) var(--space-32);
}
.hero h1 {
  font-size: var(--text-heading-lg);
  letter-spacing: var(--tracking-h-lg);
  margin-bottom: var(--space-12);
}
.hero p, .hero #hero-sub {
  color: var(--color-slate);
  font-size: var(--text-body);
  max-width: 560px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* HEADER (renderizado por cita-app.js)                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.hdr {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-silver);
  padding: var(--space-12) var(--space-20);
  display: flex; align-items: center;
  gap: var(--space-16);
  position: sticky; top: 0; z-index: 50;
}
/* Logo — el único punto del header donde mostramos el logo de Segimon (con color) */
.hdr-logo-link {
  display: flex; align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.hdr-logo-link:hover { text-decoration: none; }
.hdr-logo-img {
  height: 32px;
  width: auto;
  display: block;
}
.hdr-main { flex: 1; min-width: 0; }
.hdr-sub {
  font-size: var(--text-caption);
  color: var(--color-slate);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hdr-actions {
  display: flex; align-items: center;
  gap: var(--space-6);
}
.hdr-btn {
  background: transparent;
  border: 1px solid var(--color-silver);
  border-radius: var(--radius-input);
  padding: var(--space-8);
  width: 38px; height: 38px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-graphite);
  transition: background .15s, border-color .15s;
}
.hdr-btn:hover { background: var(--color-paper); border-color: var(--color-stone); }
.hdr-btn svg { width: 18px; height: 18px; fill: currentColor; }
.hdr-btn.logged {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-white);
}
.hdr-btn.logged:hover { background: var(--color-brand-dk); border-color: var(--color-brand-dk); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* DRAWER lateral (menú móvil)                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

.drawer-bg {
  position: fixed; inset: 0;
  background: rgba(16, 16, 16, 0.5);
  z-index: 100;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}
.drawer-bg.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0;
  width: 320px; max-width: 86vw; height: 100%;
  background: var(--color-white);
  z-index: 101;
  transform: translateX(100%);
  transition: transform .25s ease-out;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-hover);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
  padding: var(--space-20);
  border-bottom: 1px solid var(--color-silver);
  display: flex; align-items: center; gap: var(--space-12);
}
.drawer-user-name { font-weight: 600; font-size: var(--text-body-sm); color: var(--color-graphite); }
.drawer-user-email { font-size: var(--text-caption); color: var(--color-slate); margin-top: 2px; }
.drawer-close {
  background: transparent; border: 0;
  font-size: 24px; line-height: 1;
  color: var(--color-slate);
  cursor: pointer; padding: var(--space-4);
  margin-left: auto;
}
.drawer-nav { padding: var(--space-12); flex: 1; overflow-y: auto; }
.drawer-link {
  display: flex; align-items: center;
  gap: var(--space-12);
  padding: var(--space-12) var(--space-16);
  color: var(--color-graphite);
  font-size: var(--text-body-sm);
  font-weight: 400;
  border-radius: var(--radius-input);
  text-decoration: none;
  transition: background .12s;
}
.drawer-link:hover { background: var(--color-paper); text-decoration: none; }
.drawer-link svg { width: 18px; height: 18px; fill: currentColor; opacity: .7; }

/* Versión destacada (para enlaces especiales tipo SegiPuntos) */
.drawer-link-highlight {
  background: linear-gradient(135deg, #f0fdf4 0%, #e6f6e6 100%);
  color: var(--color-brand-dk) !important;
  font-weight: 500;
  position: relative;
}
.drawer-link-highlight svg { opacity: 1; color: var(--color-brand); }
.drawer-link-highlight:hover {
  background: linear-gradient(135deg, #e6f6e6 0%, #d1f0d1 100%);
}
.drawer-link-badge {
  margin-left: auto;
  background: var(--color-brand);
  color: var(--color-white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-tag);
  letter-spacing: 0.06em;
}
.drawer-divider { height: 1px; background: var(--color-silver); margin: var(--space-12) var(--space-16); }
.drawer-footer {
  padding: var(--space-16) var(--space-20);
  border-top: 1px solid var(--color-silver);
  font-size: var(--text-caption);
  color: var(--color-stone);
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* CARDS                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--card-pad);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-16);
  /* SIN borde (regla cal.com: "Do not use borders on cards") */
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--text-subheading);
  font-weight: 600;
  color: var(--color-graphite);
  letter-spacing: var(--tracking-subhead);
  margin-bottom: var(--space-16);
  display: flex; align-items: center; gap: var(--space-10);
}
/* Número del paso del formulario (1, 2, 3, 4) — pill negra */
.card-title .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  background: var(--color-ink);
  color: var(--color-white);
  border-radius: var(--radius-tag);
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* FORMS — fields, inputs, selects, textareas                                 */
/* ─────────────────────────────────────────────────────────────────────────── */

.field { margin-bottom: var(--space-16); }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-graphite);
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-body-sm);
}
.req { color: var(--color-brand); font-weight: 600; margin-left: 2px; }
.hint {
  font-size: var(--text-caption);
  color: var(--color-slate);
  margin-top: var(--space-6);
  line-height: var(--leading-caption);
  letter-spacing: var(--tracking-caption);
}

input[type="text"], input[type="email"], input[type="tel"], input[type="number"],
input[type="password"], input[type="date"], input[type="search"],
select, textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  color: var(--color-graphite);
  background: var(--color-white);
  border: 1px solid var(--color-silver);
  border-radius: var(--radius-input);
  padding: var(--space-10) var(--space-12);
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  letter-spacing: var(--tracking-body);
}
input::placeholder, textarea::placeholder {
  color: var(--color-stone);
  font-weight: 300;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--color-brand);
  box-shadow: var(--shadow-input);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--color-paper);
  color: var(--color-slate);
  cursor: not-allowed;
}
textarea { min-height: 100px; resize: vertical; line-height: var(--leading-body); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236b7280'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Inputs con icono dentro */
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 44px; }
.input-icon-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-stone);
  border-radius: var(--radius-input);
}
.input-icon-btn:hover { color: var(--color-graphite); background: var(--color-paper); }
.input-icon-btn svg { width: 18px; height: 18px; fill: currentColor; }

/* Grid 2 columnas (para inputs cortos) */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
}

/* Checkboxes con label */
.checkbox-label {
  display: flex; gap: var(--space-12);
  align-items: flex-start;
  cursor: pointer;
  font-size: var(--text-body-sm);
  color: var(--color-graphite);
  line-height: var(--leading-body-sm);
  letter-spacing: var(--tracking-body-sm);
}
.checkbox-label input[type="checkbox"] {
  margin-top: 2px;
  width: 18px; height: 18px;
  flex-shrink: 0;
  accent-color: var(--color-brand);
  cursor: pointer;
}
.legal-check { font-size: var(--text-caption); color: var(--color-slate); }
.legal-check a { color: var(--color-brand); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* BUTTONS                                                                     */
/* ─────────────────────────────────────────────────────────────────────────── */

.btn, .btn-submit, button.btn-modal-ok {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-8);
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-body-sm);
  border: 0;
  padding: var(--space-12) var(--space-24);
  border-radius: var(--radius-pill);   /* PILL: 9999px según cal.com */
  cursor: pointer;
  transition: background .12s, transform .08s, opacity .12s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active, .btn-submit:active { transform: translateY(1px); }

/* Primary CTA — verde Segimon (en lugar del Ink por defecto de cal.com) */
.btn, .btn-submit, .btn-primary, button.btn-modal-ok {
  background: var(--color-brand);
  color: var(--color-white);
}
.btn:hover, .btn-submit:hover, .btn-primary:hover, button.btn-modal-ok:hover {
  background: var(--color-brand-dk);
}
.btn:disabled, .btn-submit:disabled {
  background: var(--color-silver);
  color: var(--color-stone);
  cursor: not-allowed;
}

/* Secondary: ghost pill (outline) */
.btn-secondary, .btn-ghost {
  background: var(--color-white);
  color: var(--color-graphite);
  border: 1px solid var(--color-silver);
}
.btn-secondary:hover, .btn-ghost:hover {
  background: var(--color-paper);
  border-color: var(--color-stone);
}

/* Danger */
.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
}
.btn-danger:hover { background: #b91c1c; }

/* Row de botones (align right) */
.btn-row {
  display: flex; gap: var(--space-12);
  justify-content: flex-end;
  margin-top: var(--space-16);
}

.submit-row {
  display: flex; flex-direction: column; align-items: stretch;
  gap: var(--space-12);
  margin-top: var(--space-12);
}
.submit-row .btn-submit { width: 100%; padding: var(--space-16) var(--space-24); font-size: var(--text-body); }

/* Botón modal "ok" simple ya cubierto. Modal close: */
.modal-close {
  background: transparent; border: 0;
  cursor: pointer;
  padding: var(--space-8);
  border-radius: var(--radius-input);
  color: var(--color-slate);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--color-paper); color: var(--color-graphite); }
.modal-close svg { width: 20px; height: 20px; fill: currentColor; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* ALERTS / banners                                                           */
/* ─────────────────────────────────────────────────────────────────────────── */

.alert {
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  font-size: var(--text-body-sm);
  line-height: var(--leading-body-sm);
  letter-spacing: var(--tracking-body-sm);
  margin-bottom: var(--space-16);
  display: flex; align-items: center;
  gap: var(--space-10);
}
.alert svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}
.alert-info {
  background: var(--color-info-bg);
  color: #1e40af;
}
.alert-info a { color: var(--color-action-blue); }
.alert-success {
  background: var(--color-brand-lt);
  color: var(--color-brand-dk);
}
.alert-success a { color: var(--color-brand-dk); }
.alert-warn {
  background: var(--color-warn-bg);
  color: #92400e;
}
.alert-error {
  background: var(--color-danger-bg);
  color: #991b1b;
}

.form-error {
  background: var(--color-danger-bg);
  color: #991b1b;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-input);
  font-size: var(--text-body-sm);
  margin-bottom: var(--space-16);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* LINKS                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.link, a.link {
  color: var(--color-brand);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.link:hover, a.link:hover { color: var(--color-brand-dk); opacity: 0.85; text-decoration: none; }

.link-block {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--color-brand);
  font-size: var(--text-body-sm);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-6) 0;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* CAPTCHA row                                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

.captcha-row {
  display: flex; align-items: center; gap: var(--space-12);
}
.captcha-label {
  font-size: var(--text-body-sm);
  color: var(--color-graphite);
  flex: 1;
}
.captcha-row input { max-width: 100px; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* MODAL                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(16, 16, 16, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: var(--space-16);
}
.modal {
  background: var(--color-white);
  border-radius: var(--radius-card);
  max-width: 520px; width: 100%;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-hover);
}
.modal-header {
  padding: var(--space-20) var(--space-24) var(--space-12);
  font-family: var(--font-heading);
  font-size: var(--text-subheading);
  font-weight: 600;
  color: var(--color-graphite);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-body {
  padding: var(--space-12) var(--space-24);
  font-size: var(--text-body-sm);
  color: var(--color-graphite);
  overflow-y: auto;
  line-height: var(--leading-body);
}
.modal-footer {
  padding: var(--space-16) var(--space-24);
  border-top: 1px solid var(--color-silver);
  display: flex; justify-content: flex-end; gap: var(--space-12);
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* SLOTS de horario (reservar)                                                */
/* ─────────────────────────────────────────────────────────────────────────── */

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-12);
}
.slot-btn {
  background: var(--color-white);
  color: var(--color-graphite);
  border: 1px solid var(--color-silver);
  border-radius: var(--radius-input);
  padding: var(--space-10) var(--space-12);
  font-size: var(--text-body-sm);
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all .12s;
  text-align: center;
}
.slot-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}
.slot-btn.selected {
  background: var(--color-brand);
  color: var(--color-white);
  border-color: var(--color-brand);
}
.slot-loading, .slot-empty {
  text-align: center;
  color: var(--color-slate);
  padding: var(--space-24);
  font-size: var(--text-body-sm);
  grid-column: 1 / -1;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* PLATE — Matrícula española estilo placa                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

.matricula {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* Cuando .matricula es un input, hacerlo prominente (destacar la pieza clave) */
input.matricula {
  font-size: var(--text-subheading);
  letter-spacing: 0.08em;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────────────────── */
/* BOX de estado (éxito/error en reservar)                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

.state-box {
  text-align: center;
  padding: var(--space-40) var(--space-24);
}
.state-icon-wrap {
  width: 64px; height: 64px;
  margin: 0 auto var(--space-20);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-brand-lt);
}
.success-box, .error-box {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-40) var(--space-32);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.success-icon, .error-icon {
  width: 64px; height: 64px;
  margin: 0 auto var(--space-20);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.success-icon { background: var(--color-brand-lt); color: var(--color-brand); }
.error-icon { background: var(--color-danger-bg); color: var(--color-danger); }

.success-info {
  background: var(--color-paper);
  border-radius: var(--radius-input);
  padding: var(--space-16) var(--space-20);
  margin: var(--space-24) 0;
  text-align: left;
}
.success-info-row {
  display: flex; justify-content: space-between;
  padding: var(--space-6) 0;
  font-size: var(--text-body-sm);
}
.success-info-row strong { font-weight: 500; color: var(--color-graphite); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* CUENTA — pestañas, vehículos, historial                                    */
/* ─────────────────────────────────────────────────────────────────────────── */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-silver);
  margin-bottom: var(--space-20);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: var(--space-12) var(--space-20);
  font-size: var(--text-body-sm);
  font-weight: 500;
  color: var(--color-slate);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  letter-spacing: var(--tracking-body-sm);
  transition: color .12s, border-color .12s;
  font-family: var(--font-sans);
}
.tab:hover { color: var(--color-graphite); }
.tab.active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
}

/* Card de vehículo en "Mis vehículos" */
.vehiculo-card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-20);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-12);
  transition: box-shadow .15s;
}
.vehiculo-card:hover { box-shadow: var(--shadow-hover); }
.vehiculo-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}
.vehiculo-plate {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-weight: 600;
  background: var(--color-graphite);
  color: var(--color-white);
  padding: 4px 10px;
  border-radius: var(--radius-input);
  font-size: var(--text-body-sm);
  letter-spacing: 0.06em;
}
.vehiculo-name {
  font-weight: 500;
  font-size: var(--text-body);
  color: var(--color-graphite);
}
.vehiculo-meta {
  font-size: var(--text-caption);
  color: var(--color-slate);
  letter-spacing: var(--tracking-caption);
}
.vehiculo-visits {
  font-size: var(--text-caption);
  color: var(--color-stone);
  margin-top: var(--space-6);
}

/* Historial — items */
.hist-item-wrap { margin-bottom: var(--space-8); }
.hist-item {
  background: var(--color-white);
  border-radius: var(--radius-card);
  padding: var(--space-16) var(--space-20);
  box-shadow: var(--shadow-card);
  display: flex; align-items: center;
  gap: var(--space-12);
  cursor: pointer;
  transition: box-shadow .15s;
}
.hist-item:hover { box-shadow: var(--shadow-hover); }
.hist-fecha {
  flex-shrink: 0;
  font-size: var(--text-caption);
  color: var(--color-slate);
  font-weight: 500;
  min-width: 70px;
  letter-spacing: var(--tracking-caption);
}
.hist-veh {
  flex: 1; min-width: 0;
}
.hist-trabajo {
  font-size: var(--text-body-sm);
  color: var(--color-graphite);
  font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist-or {
  font-size: var(--text-caption);
  color: var(--color-stone);
  margin-top: 2px;
  letter-spacing: var(--tracking-caption);
}
.hist-estado, .hist-badge {
  font-size: var(--text-caption);
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-tag);
  white-space: nowrap;
  letter-spacing: var(--tracking-caption);
}
/* Variantes según el estado de la visita / factura */
.hist-badge-done {
  background: var(--color-brand-lt);
  color: var(--color-brand-dk);
}
.hist-badge-progress {
  background: var(--color-warn-bg);
  color: #92400e;
}
.hist-badge-other {
  background: var(--color-paper);
  color: var(--color-slate);
}
.hist-chev {
  color: var(--color-stone);
  font-size: 14px;
  flex-shrink: 0;
}
.hist-track-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--text-caption);
  color: var(--color-brand);
  text-decoration: none;
  font-weight: 500;
}
.hist-track-link:hover { color: var(--color-brand-dk); opacity: 0.85; text-decoration: none; }
.hd-empty {
  text-align: center;
  padding: var(--space-40);
  color: var(--color-slate);
  font-size: var(--text-body-sm);
}

/* Detalle expandible del histórico */
.hist-detalle {
  background: var(--color-paper);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  margin-top: -8px;
  overflow: hidden;
  transition: max-height .25s, padding .25s;
}
.hist-detalle.collapsed { max-height: 0; padding: 0; }
.hist-detalle-inner { padding: var(--space-16) var(--space-20); }
.hist-detalle-loading {
  text-align: center;
  padding: var(--space-20);
  color: var(--color-slate);
  font-size: var(--text-body-sm);
}

/* Eventos del tracking dentro del detalle */
.hd-section-title {
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-slate);
  margin: var(--space-12) 0 var(--space-8);
}
.hd-section-title:first-child { margin-top: 0; }
.hd-evento {
  display: flex; gap: var(--space-12);
  padding: var(--space-8) 0;
}
.hd-evento-hora {
  font-size: var(--text-caption);
  color: var(--color-stone);
  min-width: 60px;
  font-variant-numeric: tabular-nums;
}
.hd-evento-tipo {
  font-weight: 500;
  font-size: var(--text-body-sm);
  color: var(--color-graphite);
}
.hd-evento-body {
  font-size: var(--text-caption);
  color: var(--color-slate);
  margin-top: 2px;
  line-height: var(--leading-caption);
}
.hd-timeline {
  border-left: 1px solid var(--color-silver);
  padding-left: var(--space-12);
}
.hd-fotos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-8);
  margin-top: var(--space-12);
}
.hd-foto {
  border-radius: var(--radius-input);
  overflow: hidden;
  background: var(--color-silver);
  aspect-ratio: 4 / 3;
}
.hd-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hd-info {
  display: flex; gap: var(--space-12);
  flex-wrap: wrap;
  margin-bottom: var(--space-12);
}
.hd-info-pill {
  font-size: var(--text-caption);
  background: var(--color-white);
  padding: 4px 12px;
  border-radius: var(--radius-tag);
  color: var(--color-slate);
  border: 1px solid var(--color-silver);
}

/* Estado vacío genérico */
.empty-state {
  text-align: center;
  padding: var(--space-48) var(--space-24);
  color: var(--color-slate);
  font-size: var(--text-body-sm);
}
.empty-state strong { color: var(--color-graphite); font-weight: 500; }

/* Los SVG dentro de empty-state heredarían ancho 100% sin estos límites,
   creando iconos gigantes que ocupan toda la página.
   !important porque .card empty-state combinado puede tener problemas
   de especificidad con SW cacheado. */
.empty-state > svg,
.empty-state svg {
  width: 56px !important;
  height: 56px !important;
  max-width: 56px !important;
  fill: var(--color-stone);
  opacity: .55;
  display: block;
  margin: 0 auto var(--space-16);
}
.empty-state p { margin: 0 0 var(--space-8); line-height: 1.5; }
.empty-state p:last-child { margin-bottom: 0; }

/* ─────────────────────────────────────────────────────────────────────────── */
/* FOOTER                                                                      */
/* ─────────────────────────────────────────────────────────────────────────── */

.foot {
  text-align: center;
  padding: var(--space-48) var(--space-20);
  color: var(--color-stone);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-caption);
}
.foot a { color: var(--color-slate); }

/* ─────────────────────────────────────────────────────────────────────────── */
/* UTILS                                                                       */
/* ─────────────────────────────────────────────────────────────────────────── */

.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }   .mt-8 { margin-top: 8px; }   .mt-16 { margin-top: 16px; }   .mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-16 { margin-bottom: 16px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--color-silver);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: sp 0.7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────────────────── */
/* RESPONSIVE — móvil                                                         */
/* ─────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .hero { padding: var(--space-32) var(--space-16) var(--space-24); }
  .hero h1 { font-size: var(--text-heading); }
  .card { padding: var(--space-20); }
  .card-title { font-size: var(--text-body); }
  body { font-size: var(--text-body-sm); }
  .hdr { padding: var(--space-10) var(--space-16); }
  .hdr-logo-img { height: 28px; }
}

/* ════════════════════════════════════════════════════════════════════════
   APP SHELL: top bar verde + bottom tab bar
   Compartido entre TODAS las páginas de cita.segimonautomocio.com para
   que la app tenga el mismo lenguaje visual en todas las secciones.
   Inyectado por cita-app.js → renderShell() + renderTabBar().
   ──────────────────────────────────────────────────────────────────── */
:root {
  --shell-pad-x: 18px;
  --shell-safe-bot: env(safe-area-inset-bottom, 0px);
  --shell-safe-top: env(safe-area-inset-top, 0px);
}

/* En móvil escondemos el header tradicional y el drawer porque su
   funcionalidad la cubre el top bar verde + bottom tab bar. */
@media (max-width: 768px) {
  body.has-shell .hdr,
  body.has-shell #drawer-bg,
  body.has-shell #drawer { display: none !important; }
}

body.has-shell {
  margin: 0;
  background: #f6f7f9;
  -webkit-tap-highlight-color: transparent;
  /* overflow-x: clip es la versión moderna que NO rompe el scroll vertical
     en iOS Safari como sí hace overflow-x: hidden. Fallback al hidden. */
  overflow-x: hidden;
  overflow-x: clip;
  /* iOS: inertia scroll suave y permitir el scroll vertical */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
html.has-shell-html, html { -webkit-text-size-adjust: 100%; }

/* ── TOP BAR ───────────────────────────────────────────────────── */
.shell-topbar {
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dk) 100%);
  color: #fff;
  padding: calc(14px + var(--shell-safe-top)) var(--shell-pad-x) 22px;
  position: relative;
}
.shell-topbar.compact { padding-bottom: 18px; }
.shell-topbar-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.shell-brand {
  display: flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none;
}
.shell-brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.16);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.shell-brand-icon svg { width: 22px; height: 22px; fill: #fff; }
.shell-brand-icon img { width: 100%; height: 100%; object-fit: contain; padding: 4px; box-sizing: border-box; }
.shell-brand-name { font-size: 17px; font-weight: 700; line-height: 1.1; letter-spacing: -0.2px; }
.shell-brand-sub  { font-size: 11px; opacity: 0.82; line-height: 1; margin-top: 2px; font-weight: 500; }
.shell-topbar-actions { display: flex; align-items: center; gap: 8px; }
.shell-topbar-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.16);
  border: none; border-radius: 10px;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: background 0.15s ease;
}
.shell-topbar-btn:active { background: rgba(255,255,255,0.28); }
.shell-topbar-btn svg { width: 20px; height: 20px; fill: #fff; }
.shell-topbar-btn .badge-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; background: #f43f5e;
  border-radius: 50%; border: 2px solid var(--green);
  display: none;
}
.shell-topbar-btn.has-notif .badge-dot { display: block; }
.shell-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.22);
  color: #fff; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.4);
  font-family: inherit;
  padding: 0;
}
.shell-greeting {
  margin-top: 18px;
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.6px; line-height: 1.15;
}
.shell-greeting.small { font-size: 18px; margin-top: 14px; }
.shell-subtitle { font-size: 13px; opacity: 0.9; margin-top: 4px; font-weight: 500; }

/* Botón "atrás" (para subpáginas internas) */
.shell-back-btn {
  width: 38px; height: 38px;
  background: rgba(255,255,255,0.16);
  border: none; border-radius: 10px;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  margin-right: 8px;
}
.shell-back-btn svg { width: 20px; height: 20px; fill: #fff; }

/* ── CONTENIDO PRINCIPAL ───────────────────────────────────────── */
.shell-main {
  padding: 16px var(--shell-pad-x) 110px; /* 110px = altura tab bar + safe */
  max-width: 540px;
  margin: 0 auto;
}
.shell-main.no-tabbar { padding-bottom: 32px; }

/* ── BOTTOM TAB BAR ────────────────────────────────────────────── */
.shell-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: #fff;
  border-top: 0.5px solid var(--border);
  padding: 8px 6px calc(8px + var(--shell-safe-bot));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  z-index: 50;
  max-width: 540px;
  margin: 0 auto;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}
.shell-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px;
  background: none; border: none;
  color: var(--text3);
  cursor: pointer; text-decoration: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.shell-tab svg { width: 22px; height: 22px; fill: currentColor; transition: transform 0.15s ease; }
.shell-tab span { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; }
.shell-tab.active { color: var(--green); }
.shell-tab.active svg { transform: translateY(-1px); }
.shell-tab:active svg { transform: scale(0.9); }

@media (min-width: 769px) {
  body.has-shell { background: #f0f1f3; }
  .shell-topbar { border-radius: 0 0 24px 24px; }
  .shell-main.no-tabbar { padding-bottom: 40px; }
  .shell-tabbar {
    border-radius: 16px 16px 0 0;
    bottom: 16px;
    max-width: 540px;
    left: 50%; transform: translateX(-50%);
    right: auto;
    width: calc(100% - 32px);
  }
}

/* ── PRIMITIVAS UI compartidas ────────────────────────────────── */
.shell-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 26px 0 12px 4px;
}
.shell-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  border: 0.5px solid rgba(0,0,0,0.04);
  margin-bottom: 12px;
}
.shell-card.hover { cursor: pointer; transition: transform 0.12s ease; }
.shell-card.hover:active { transform: scale(0.98); }

.shell-list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border-radius: 12px;
  text-decoration: none;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 0.5px solid rgba(0,0,0,0.04);
  cursor: pointer;
  transition: transform 0.12s ease;
}
.shell-list-row:active { transform: scale(0.985); }
.shell-list-row-icon {
  width: 38px; height: 38px;
  background: var(--green-lt);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.shell-list-row-icon svg { width: 20px; height: 20px; fill: var(--green); }
.shell-list-row-body { flex: 1; min-width: 0; }
.shell-list-row-title { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.25; }
.shell-list-row-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; line-height: 1.35; }
.shell-list-row-arrow svg { width: 16px; height: 16px; fill: var(--text3); flex-shrink: 0; }

.shell-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--text3);
  font-size: 13px;
  line-height: 1.5;
}
.shell-empty-icon {
  width: 56px; height: 56px;
  background: var(--green-lt);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.shell-empty-icon svg { width: 28px; height: 28px; fill: var(--green); }
.shell-empty-title { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 4px; }

.shell-skel {
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: shell-shimmer 1.4s infinite;
  color: transparent !important;
  border-radius: 6px;
  display: inline-block;
  min-width: 50px;
}
@keyframes shell-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── GARANTÍA DE NO-UNDERLINE EN TODA LA APP ────────────────────────────
   Override agresivo final. Ningún link debe mostrar subrayado en ningún
   estado, salvo que esté explícitamente marcado con la clase .underline
   (que reservamos para casos muy específicos como avisos legales).
   ──────────────────────────────────────────────────────────────────── */
a, a:link, a:visited, a:hover, a:focus, a:active,
button, button:hover, button:focus, button:active,
.link, .link:hover, .link:focus, .link:active,
.shell-tab, .shell-tab:hover,
.hist-track-link, .hist-track-link:hover,
.dash-tile, .dash-tile *, .dash-tile:hover, .dash-tile:hover *,
.next-cita, .next-cita *, .next-cita:hover, .next-cita:hover *,
.saldo-card, .saldo-card *, .saldo-card:hover, .saldo-card:hover *,
.tile, .tile:hover, .stat-card, .stat-card:hover,
.shell-list-row, .shell-list-row:hover, .shell-list-row *,
.shell-brand, .shell-brand:hover, .shell-brand *,
.shell-avatar, .shell-avatar:hover,
.drawer-link, .drawer-link:hover {
  text-decoration: none !important;
}

/* Excepción explícita: clase .underline para casos justificados */
.underline { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════════
   SISTEMA PREMIUM v1 — sombras estratificadas, tab bar iOS17,
   microinteracciones, toast, pull-to-refresh, page transitions.
   ──────────────────────────────────────────────────────────────────── */

:root {
  /* Sistema de elevation Apple-style: multi-capa con ambient + key */
  --shadow-z0: none;
  --shadow-z1: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-z2: 0 2px 4px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-z3: 0 4px 8px rgba(15, 23, 42, 0.07), 0 16px 40px rgba(15, 23, 42, 0.10);
  --shadow-z4: 0 8px 24px rgba(15, 23, 42, 0.10), 0 24px 64px rgba(15, 23, 42, 0.16);

  /* Curvas físicas tipo iOS/spring — sensación natural al moverse */
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);    /* overshoot tipo spring */
  --ease-out-soft:  cubic-bezier(0.16, 1, 0.3, 1);        /* out muy suave */
  --ease-in-out:    cubic-bezier(0.65, 0, 0.35, 1);       /* in-out limpio */
  --ease-snappy:    cubic-bezier(0.2, 0, 0, 1);           /* salida rápida material */
}

/* ── PAGE TRANSITION (fade-in sutil al cargar cualquier página) ── */
body.has-shell .shell-main {
  animation: page-fade-in 0.4s var(--ease-out-soft);
  animation-fill-mode: backwards;
}
@keyframes page-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── ELEVATION aplicado a primitivas existentes ────────────────── */
body.has-shell .shell-card {
  box-shadow: var(--shadow-z1);
  border: none;
  transition: box-shadow 0.25s var(--ease-out-soft), transform 0.25s var(--ease-spring);
}
body.has-shell .shell-card.hover:active,
body.has-shell .shell-list-row:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-z1);
}
body.has-shell .shell-list-row {
  box-shadow: var(--shadow-z1);
  border: none;
  transition: box-shadow 0.2s var(--ease-out-soft), transform 0.2s var(--ease-spring);
}

/* ── HAPTIC VISUAL UNIVERSAL ────────────────────────────────────── */
/* Cualquier elemento clicable que tenga esta clase aplica spring scale al press. */
.haptic, body.has-shell .tile, body.has-shell .stat-card,
body.has-shell .hero-cta, body.has-shell .repair-card {
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out-soft);
  will-change: transform;
}
.haptic:active,
body.has-shell .tile:active,
body.has-shell .stat-card:active,
body.has-shell .hero-cta:active,
body.has-shell .repair-card:active {
  transform: scale(0.96);
}

/* ── BOTTOM TAB BAR PREMIUM (iOS17 style) ──────────────────────── */
.shell-tabbar {
  /* Backdrop blur translucent — efecto "liquid glass" tipo iOS */
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 -1px 0 rgba(255,255,255,0.5) inset, var(--shadow-z2);
  padding-top: 6px;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .shell-tabbar { background: rgba(255, 255, 255, 0.96); }
}

.shell-tab {
  position: relative;
  padding: 8px 4px;
  isolation: isolate;
  transition: color 0.3s var(--ease-out-soft);
}
.shell-tab span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: opacity 0.2s var(--ease-out-soft), transform 0.3s var(--ease-spring);
}

/* Indicador-pill que aparece detrás del icono cuando el tab está activo */
.shell-tab::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 50%;
  width: 56px;
  height: 34px;
  background: var(--green-lt);
  border-radius: 100px;
  transform: translateX(-50%) scale(0.4);
  opacity: 0;
  z-index: -1;
  transition:
    transform 0.45s var(--ease-spring),
    opacity 0.25s var(--ease-out-soft);
}
.shell-tab.active::before {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}
.shell-tab.active { color: var(--green); }

/* Iconos del tab bar: UN solo SVG filled.
   Al activarse cambia color (verde) y aparece el pill detrás. Sin morphs. */
.shell-tab .tab-icons {
  position: relative;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.shell-tab .tab-icons svg {
  width: 24px; height: 24px;
  fill: currentColor;
  transition: transform 0.4s var(--ease-spring);
}
.shell-tab:active .tab-icons svg { transform: scale(0.88); }
.shell-tab.active .tab-icons svg { transform: scale(1.05); }

/* ── TOAST NOTIFICATIONS (spring, blur, tipo iOS) ──────────────── */
.toast-container {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 380px;
}
.toast {
  background: rgba(20, 20, 22, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  color: #fff;
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  letter-spacing: -0.1px;
  opacity: 0;
  transform: translateY(-24px) scale(0.92);
  transition:
    opacity 0.25s var(--ease-out-soft),
    transform 0.5s var(--ease-spring);
  pointer-events: auto;
  box-shadow: var(--shadow-z3);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateY(0) scale(1); }
.toast.hiding { opacity: 0; transform: translateY(-16px) scale(0.96); }
.toast-success { background: rgba(6, 166, 0, 0.92); }
.toast-error   { background: rgba(220, 38, 38, 0.92); }
.toast-info    { background: rgba(28, 28, 30, 0.92); }
.toast svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

/* ── PULL-TO-REFRESH ────────────────────────────────────────────── */
.pull-indicator {
  position: fixed;
  top: calc(80px + env(safe-area-inset-top, 0px));
  left: 50%;
  margin-left: -22px;
  width: 44px; height: 44px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-z2);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
  opacity: 0;
  transform: translateY(-60px) scale(0.6);
  transition:
    opacity 0.2s var(--ease-out-soft),
    transform 0.4s var(--ease-spring);
  pointer-events: none;
}
.pull-indicator svg { width: 22px; height: 22px; fill: var(--green); }
.pull-indicator.refreshing svg { animation: ptr-spin 0.9s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ── SKELETON SHIMMER MEJORADO (más profesional) ─────────────────── */
.shell-skel {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.06) 25%,
    rgba(0,0,0,0.10) 50%,
    rgba(0,0,0,0.06) 75%
  );
  background-size: 200% 100%;
  animation: shell-shimmer 1.8s var(--ease-in-out) infinite;
  color: transparent !important;
  border-radius: 6px;
  display: inline-block;
  min-width: 50px;
}
@keyframes shell-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── EFECTO PRESS EN AVATARES Y BOTONES DEL TOPBAR ─────────────── */
.shell-avatar, .shell-topbar-btn, .shell-back-btn {
  transition: transform 0.2s var(--ease-spring), background 0.2s var(--ease-out-soft);
}
.shell-avatar:active, .shell-topbar-btn:active, .shell-back-btn:active {
  transform: scale(0.92);
}

/* ── BOTONES PRIMARIOS (hero-cta, btn primary): elevación animada ── */
body.has-shell .hero-cta {
  box-shadow: 0 2px 4px rgba(6,166,0,0.18), 0 6px 16px rgba(6,166,0,0.22);
}
body.has-shell .hero-cta:active {
  box-shadow: 0 1px 2px rgba(6,166,0,0.20), 0 2px 6px rgba(6,166,0,0.18);
}

/* ── DARK MODE PARCIAL para top bar y tab bar (preparación futura) ─ */
@media (prefers-color-scheme: dark) {
  /* Comentado por ahora — descomentar cuando hagamos dark mode completo */
  /* .shell-tabbar { background: rgba(28, 28, 30, 0.72); border-top-color: rgba(255,255,255,0.08); } */
}

/* ── TIPOGRAFÍA INTER REFINADA (renderizado premium) ──────────────── */
body, body.has-shell {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11', 'ss01';
  letter-spacing: -0.011em;
}
/* Sustitución a "InterVariable" si soporta variable fonts */
@supports (font-variation-settings: normal) {
  body, body.has-shell { font-family: 'Inter var', 'Inter', system-ui, sans-serif; }
}

/* Jerarquía premium en cabeceras */
.shell-greeting {
  font-weight: 700;
  letter-spacing: -0.025em;   /* tracking apretado tipo Apple display */
}
.shell-brand-name {
  font-weight: 700;
  letter-spacing: -0.015em;
}
.shell-section-title {
  font-weight: 700;
  letter-spacing: 0.06em;     /* tracking abierto en uppercase tipo IBM Plex */
  font-size: 11px;
}

/* Números con tabular para alineación perfecta (saldos, días, etc.) */
.stat-value, .hero-block-val, .repair-title {
  font-variant-numeric: tabular-nums;
}

/* ── EMPTY STATES PREMIUM (con ilustración) ────────────────────── */
.shell-empty-card {
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px 22px;
  text-align: center;
  box-shadow: var(--shadow-z1);
  margin-top: 8px;
  animation: page-fade-in 0.5s var(--ease-out-soft);
}
.shell-empty-illustration {
  width: 200px;
  height: 120px;
  margin: 0 auto 8px;
}
.shell-empty-illustration svg { width: 100%; height: 100%; }
.shell-empty-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-top: 4px;
}
.shell-empty-text {
  font-size: 13.5px;
  color: var(--text2);
  margin-top: 8px;
  line-height: 1.5;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}
.shell-empty-text strong { color: var(--text); font-weight: 600; }
.shell-empty-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 11px 18px;
  background: var(--green);
  color: #fff !important;
  border-radius: 100px;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out-soft);
  box-shadow: 0 2px 4px rgba(6,166,0,0.18), 0 6px 16px rgba(6,166,0,0.22);
}
.shell-empty-cta:active { transform: scale(0.96); }

/* ── DETALLES PRO ADICIONALES ──────────────────────────────────── */

/* 1. Smooth scroll global */
html { scroll-behavior: smooth; }

/* 2. Selección de texto con color de marca */
::selection { background: rgba(6,166,0,0.22); color: var(--text); }

/* 3. Tap-highlight transparente en todos los clicables (iOS más limpio) */
a, button, [role="button"], .shell-card, .shell-list-row, .tile, .stat-card {
  -webkit-tap-highlight-color: transparent;
}

/* 4. Scrollbars finos en desktop (sin afectar móvil) */
@media (pointer: fine) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.18);
    border-radius: 100px;
    transition: background 0.2s;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.35); }
}

/* 5. Focus rings accesibles solo con teclado (no con click) */
:focus { outline: none; }
:focus-visible {
  outline: 2.5px solid var(--green);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 6. Tap feedback en links del top bar al press (ripple sutil) */
.shell-brand { transition: transform 0.2s var(--ease-spring); }
.shell-brand:active { transform: scale(0.97); }

/* 7. Disabled states consistentes */
button:disabled, .btn:disabled, .hero-cta:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 8. Mejora del active state de los .stat-card (mini-elevation) */
body.has-shell .stat-card {
  box-shadow: var(--shadow-z1);
  border: none;
}

/* 9. .tile activo: bonito hover en desktop */
@media (hover: hover) {
  body.has-shell .tile:hover,
  body.has-shell .stat-card:hover,
  body.has-shell .shell-list-row:hover {
    box-shadow: var(--shadow-z2);
    transform: translateY(-2px);
  }
  body.has-shell .hero-cta:hover {
    box-shadow: 0 3px 6px rgba(6,166,0,0.22), 0 10px 24px rgba(6,166,0,0.28);
  }
}

/* 10. .repair-card con efecto shimmer sutil (siempre activo, llama atención) */
.repair-card {
  position: relative;
  overflow: hidden;
}
.repair-card::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: repair-shine 3s ease-in-out infinite;
}
@keyframes repair-shine {
  0%, 100% { left: -50%; }
  50% { left: 150%; }
}
