/* Barbería Express — base y tokens de diseño (rediseño, lote 1).
   Regla de color 80/15/5: 80 % neutro claro, 15 % color de marca, 5 % acción principal.
   --marca se cambia por cliente; el resto de la paleta no depende de él. */

/* DM Sans local (OFL, ver /fonts/OFL.txt): sin peticiones a Google y disponible sin conexión */
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/dm-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/dm-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/dm-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/dm-sans-latin-700-normal.woff2') format('woff2'); }

:root {
  /* Color */
  --fondo: #F7F7F5;
  --superficie: #FFFFFF;
  --borde: #E6E4DF;
  --texto: #18181B;           /* 16,5:1 sobre --fondo */
  --texto-2: #5F6368;         /* 5,6:1 sobre --fondo */
  --marca: #0B2A4A;           /* 14,5:1 sobre blanco */
  --marca-suave: #EEF2F7;
  --accion: #C8102E;
  --accion-hover: #A50D26;
  --whatsapp: #178143;        /* texto blanco 4,9:1 (antes #1F8F4E, 4,1:1) */
  --verde: #2E7D32;
  --verde-suave: #E8F3E9;
  --ambar: #9A6700;
  --ambar-suave: #FFF4D6;

  /* Estados de cita (se usan desde el lote 3) */
  --e-confirmada: #1D4ED8;    --e-confirmada-fondo: #EFF4FF;
  --e-sin-marcar: #B54708;    --e-sin-marcar-fondo: #FFFAEB;
  --e-completada: #15803D;    --e-completada-fondo: #ECFDF3;
  --e-no-vino: #B42318;       --e-no-vino-fondo: #FEF3F2;
  --e-cancelada: #4B5563;     --e-cancelada-fondo: #F3F4F6;

  /* Espaciado (escala de 4) */
  --esp-1: 4px; --esp-2: 8px; --esp-3: 12px; --esp-4: 16px;
  --esp-5: 24px; --esp-6: 32px; --esp-7: 48px;

  /* Radios y sombras */
  --radio-s: 8px; --radio-m: 12px; --radio-l: 16px;
  --radio: 14px;              /* valor actual; los componentes pasan a la escala en los lotes 2-4 */
  --sombra-1: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --sombra-2: 0 4px 8px rgba(16, 24, 40, .08), 0 12px 32px rgba(16, 24, 40, .10);

  /* Tipografía */
  --fuente: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --t-xs: 12px; --t-s: 14px; --t-m: 16px; --t-l: 18px; --t-xl: 22px; --t-2xl: 28px;

  /* Movimiento */
  --dur: .15s;
  --curva: cubic-bezier(.2, 0, 0, 1);

  /* Alias de los nombres antiguos: reserva.css y panel.css siguen funcionando sin cambios */
  --tarjeta: var(--superficie);
  --marino: var(--marca);
  --marino-suave: var(--marca-suave);
  --rojo: var(--accion);
  --rojo-hover: var(--accion-hover);
  --sombra: var(--sombra-1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--marino); }

.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px;
  border: 0; border-radius: 12px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-principal { background: var(--rojo); color: #fff; }
.btn-principal:not(:disabled):hover { background: var(--rojo-hover); }
.btn-secundario { background: var(--tarjeta); color: var(--marino); border: 1.5px solid var(--marino); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-bloque { width: 100%; }
.btn-texto { background: none; border: 0; color: var(--marino); font-weight: 600; padding: 8px 4px; min-height: 44px; }

:focus-visible { outline: 3px solid rgba(200, 16, 46, .35); outline-offset: 2px; border-radius: 8px; }

/* Campos */
.campo { display: grid; gap: 6px; }
.campo label { font-size: 14px; font-weight: 600; color: var(--marino); }
.campo input, .campo select {
  min-height: 52px; padding: 0 14px;
  border: 1.5px solid var(--borde); border-radius: 12px; background: var(--tarjeta);
  font-size: 16px; /* evita zoom en iPhone */
}
.campo input:focus, .campo select:focus { border-color: var(--marino); outline: none; }
.campo .ayuda { font-size: 13px; color: var(--texto-2); }
.campo.error input { border-color: var(--rojo); }
.campo .msg-error { font-size: 13px; color: var(--rojo); }

/* Avisos */
.aviso { padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.aviso-error { background: #FCE8EB; color: #8A0B20; }
.aviso-ok { background: var(--verde-suave); color: var(--verde); }

/* Carga */
.cargando { display: flex; justify-content: center; padding: 28px 0; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--marino-suave); border-top-color: var(--marino);
  animation: giro .8s linear infinite;
}
@keyframes giro { to { transform: rotate(360deg); } }

/* Logo: poste de barbería como único detalle de rayas */
.poste {
  width: 14px; height: 34px; border-radius: 7px; flex: none;
  background: repeating-linear-gradient(135deg, var(--rojo) 0 6px, #fff 6px 12px, #1B4F8C 12px 18px, #fff 18px 24px);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .7);
  background-size: 100% 34px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .spinner { animation-duration: 1.6s; animation-iteration-count: infinite !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .poste-animado { animation: poste 2.4s linear infinite; }
  @keyframes poste { to { background-position: 0 34px; } }
}
