/* Plataforma de citas The Fedex Barber Shop: base compartida (reservar + panel).
   Identidad de la página principal: el local de noche. Negro carbón, dorado del logo y crema del ticket;
   Anton para títulos, Manrope para el texto, DM Serif en cursiva para los acentos e IBM Plex Mono para etiquetas. */
@font-face { font-family: 'Anton'; src: url('fonts/anton.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('fonts/manrope.woff2') format('woff2'); font-weight: 400 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'DM Serif Display'; src: url('fonts/dmserif-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('fonts/plexmono-500.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --acento: #D4AF55; --acento-fuerte: #F3D68A; --acento-suave: rgba(212, 175, 85, .13); --borde-acento: rgba(212, 175, 85, .38);
  --sobre-acento: #14110B;
  --fondo: #0A0907; --tarjeta: #17140F; --tarjeta-2: #1F1B14; --texto: #F6EFE0; --gris: #B9AD94; --gris-claro: #1F1B14;
  --linea: rgba(212, 175, 85, .16); --crema: #F4ECD8;
  --exito: #4ADE80; --exito-soft: rgba(74, 222, 128, .12); --alerta: #F5B454; --alerta-soft: rgba(245, 180, 84, .12);
  --error: #F87171; --error-soft: rgba(248, 113, 113, .12); --error-fuerte: #C2362F;
  --grad: linear-gradient(135deg, #F6DC94 0%, #D4AF55 48%, #A37B2C 100%);
  --sombra-s: 0 1px 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(212, 175, 85, .08);
  --sombra-m: 0 8px 26px rgba(0, 0, 0, .5);
  --sombra-l: 0 18px 50px rgba(0, 0, 0, .65);
  --radio: 18px; --radio-s: 12px;
  --titulo: 'Anton', 'Impact', 'Arial Narrow', sans-serif; --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'Manrope', system-ui, -apple-system, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --seguro-abajo: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

:root[data-tema="claro"] {
  --acento: #C29A3C; --acento-fuerte: #8A6414; --acento-suave: rgba(194, 154, 60, .14); --borde-acento: rgba(150, 112, 30, .42);
  --fondo: #F7F3EA; --tarjeta: #FFFFFF; --tarjeta-2: #F1EBDD; --texto: #1E1A14; --gris: #6E6352; --gris-claro: #EFE8D8;
  --linea: rgba(120, 90, 30, .16); --crema: #FFFDF8;
  --exito: #17803F; --exito-soft: rgba(23, 128, 63, .1); --alerta: #A86400; --alerta-soft: rgba(196, 120, 0, .12);
  --error: #C2362F; --error-soft: rgba(194, 54, 47, .1);
  --sombra-s: 0 1px 2px rgba(60, 45, 20, .08), 0 0 0 1px rgba(120, 90, 30, .1);
  --sombra-m: 0 8px 24px rgba(60, 45, 20, .12);
  --sombra-l: 0 18px 46px rgba(60, 45, 20, .18);
  --esq-a: #EDE6D6; --esq-b: #F8F4EA;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans); background: var(--fondo); color: var(--texto); line-height: 1.45;
  -webkit-font-smoothing: antialiased; min-height: 100dvh;
}
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: var(--acento-fuerte); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--borde-acento); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--titulo); font-weight: 400; letter-spacing: .01em; line-height: 1.05; text-transform: uppercase; }
h1 em, h2 em, h3 em { font-family: var(--serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--acento-fuerte); }
.script { font-family: var(--mono); font-weight: 500; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--acento); }
.muted { color: var(--gris); }
.small { font-size: .85rem; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: .98rem;
  background: var(--grad); color: var(--sobre-acento); box-shadow: 0 6px 18px rgba(212, 175, 85, .22);
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s; text-decoration: none; white-space: nowrap;
}
.btn:hover { box-shadow: 0 10px 26px rgba(212, 175, 85, .32); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.sec { background: var(--tarjeta); color: var(--acento-fuerte); box-shadow: inset 0 0 0 1.5px var(--borde-acento); }
.btn.ghost { background: transparent; color: var(--acento-fuerte); box-shadow: none; }
.btn.peligro { background: var(--error-fuerte); color: #fff; box-shadow: none; }
.btn.wa { background: #1FAF54; color: #fff; box-shadow: 0 6px 18px rgba(31, 175, 84, .25); }
.btn.bloque { width: 100%; }
.btn.chico { min-height: 38px; padding: 0 14px; font-size: .88rem; }
.btn svg { width: 20px; height: 20px; flex: none; }
.icono-btn {
  width: 42px; height: 42px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--tarjeta); box-shadow: var(--sombra-s); color: var(--texto); flex: none;
}
.icono-btn svg { width: 20px; height: 20px; }

/* ---------- formularios ---------- */
.campo { display: grid; gap: 6px; margin-bottom: 14px; }
.campo > span, .etiqueta { font-size: .82rem; font-weight: 600; color: var(--gris); letter-spacing: .02em; }
.input, .campo input, .campo select, .campo textarea {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1.5px solid var(--linea);
  background: var(--tarjeta); color: var(--texto); font-size: 1rem; transition: border-color .15s, box-shadow .15s;
}
.campo textarea { min-height: 90px; resize: vertical; }
.campo input:focus, .campo select:focus, .campo textarea:focus, .input:focus {
  outline: none; border-color: var(--acento); box-shadow: 0 0 0 4px var(--acento-suave);
}
.campo .ayuda { font-size: .8rem; color: var(--gris); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--acento); flex: none; margin-top: 1px; }
.interruptor { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .92rem; }
.interruptor input { appearance: none; width: 46px; height: 28px; border-radius: 99px; background: var(--linea); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.interruptor input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--crema); box-shadow: var(--sombra-s); transition: transform .2s; }
.interruptor input:checked { background: var(--acento); }
.interruptor input:checked::after { transform: translateX(18px); }

/* ---------- tarjetas, chips ---------- */
.tarjeta { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra-s); padding: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: var(--tarjeta); border: 1.5px solid var(--linea); font-size: .9rem; font-weight: 500; white-space: nowrap;
  transition: all .15s;
}
.chip[aria-pressed="true"], .chip.activo { background: var(--acento); color: var(--sobre-acento); border-color: var(--acento); font-weight: 700; }
.pastilla { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--acento-suave); color: var(--acento-fuerte); }
.pastilla.ok { background: var(--exito-soft); color: var(--exito); }
.pastilla.mal { background: var(--error-soft); color: var(--error); }
.pastilla.aviso { background: var(--alerta-soft); color: var(--alerta); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--acento-suave); flex: none; }
.avatar.inicial { display: grid; place-items: center; font-family: var(--titulo); font-weight: 400; color: var(--acento-fuerte); }

/* ---------- hoja inferior (modal) ---------- */
.velo { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(3px); z-index: 80; opacity: 0; transition: opacity .25s; }
.velo.abierto { opacity: 1; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 81; background: var(--fondo); border-top: 1px solid var(--linea);
  border-radius: 26px 26px 0 0; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  padding: 10px 20px calc(24px + var(--seguro-abajo)); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
  box-shadow: var(--sombra-l);
}
.hoja.abierta { transform: none; }
.hoja::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--borde-acento); margin: 0 auto 14px; }
.hoja h2 { font-size: 1.6rem; margin-bottom: 4px; }
.hoja .cabeza-hoja { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
@media (min-width: 760px) {
  .hoja { left: 50%; right: auto; bottom: 50%; width: min(560px, 94vw); border-radius: 26px; transform: translate(-50%, 60%); opacity: 0; transition: transform .25s, opacity .2s; max-height: 88dvh; }
  .hoja.abierta { transform: translate(-50%, 50%); opacity: 1; }
  .hoja::before { display: none; }
}

/* ---------- avisos ---------- */
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--seguro-abajo)); z-index: 100; display: grid; gap: 8px; width: min(440px, 92vw); pointer-events: none; }
.toast { background: var(--crema); color: var(--sobre-acento); font-weight: 600; padding: 13px 18px; border-radius: 14px; box-shadow: var(--sombra-l); font-size: .92rem; animation: entra .25s ease; pointer-events: auto; }
.toast.error { background: var(--error-fuerte); color: #fff; }
.toast.ok { background: #1E7A47; color: #fff; }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }
.aviso { padding: 12px 16px; border-radius: 14px; background: var(--alerta-soft); color: var(--alerta); font-size: .9rem; }
.aviso.info { background: var(--acento-suave); color: var(--acento-fuerte); }
.aviso.error { background: var(--error-soft); color: var(--error); }

/* ---------- carga ---------- */
.esqueleto { background: linear-gradient(90deg, var(--esq-a, #17140F) 0%, var(--esq-b, #252016) 50%, var(--esq-a, #17140F) 100%); background-size: 200% 100%; animation: brillo 1.2s infinite; border-radius: 14px; }
@keyframes brillo { to { background-position: -200% 0; } }
.girando { width: 22px; height: 22px; border: 3px solid rgba(20, 17, 11, .35); border-top-color: var(--sobre-acento); border-radius: 50%; animation: gira .7s linear infinite; }
.girando.oscuro { border-color: var(--borde-acento); border-top-color: var(--acento-fuerte); }
@keyframes gira { to { transform: rotate(360deg); } }
.vacio { text-align: center; padding: 36px 18px; color: var(--gris); }
.vacio svg { width: 54px; height: 54px; color: var(--acento); margin: 0 auto 10px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.fila-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.texto-confirmar { margin-top: 6px; }

/* ---------- visor de fotos en grande ---------- */
.visor { --velo: .96; position: fixed; inset: 0; z-index: 90; background: rgba(5, 4, 3, var(--velo)); display: grid; grid-template-rows: 1fr auto; animation: aparecer .18s ease-out; }
.visor.saliendo { opacity: 0; transition: opacity .15s; }
.visor-pista { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior: contain; min-height: 0; }
.visor.acercado .visor-pista { overflow: hidden; }
.visor-pista::-webkit-scrollbar { display: none; }
.visor-foto { flex: 0 0 100%; scroll-snap-align: center; margin: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; padding: env(safe-area-inset-top, 0px) 0 0; }
.visor-marco { display: grid; place-items: center; min-height: 0; overflow: hidden; }
.visor-marco img { width: 100%; height: 100%; object-fit: contain; touch-action: pan-x; user-select: none; -webkit-user-select: none; transition: transform .12s ease-out; will-change: transform; }
.visor.acercado .visor-marco img { touch-action: none; transition: none; }
.visor-foto figcaption { color: #fff; text-align: center; display: grid; gap: 2px; padding: 10px 16px 0; }
.visor-foto figcaption strong { font-family: var(--titulo, sans-serif); font-weight: 400; text-transform: uppercase; font-size: 1.35rem; letter-spacing: .02em; }
.visor-foto figcaption span { opacity: .8; font-size: .95rem; }
.visor-cerrar { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.visor-cerrar svg { width: 24px; height: 24px; }
.visor-cuenta { color: #fff; opacity: .75; text-align: center; margin: 0; padding: 8px 0 calc(14px + env(safe-area-inset-bottom, 0px)); font-size: .85rem; }
body.con-visor { overflow: hidden; }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .visor { animation: none; } .visor-marco img { transition: none; } }

/* ---------- guía animada para instalar en iPhone (js/guia-ios.js) ---------- */
/* Ciclo de 12 s: Safari → hoja de Compartir → "Agregar a inicio" → pantalla de inicio con el ícono nuevo. */
.guia-ios { display: grid; justify-items: center; gap: 10px; margin: 6px 0 14px; }
.gi-telefono { width: 196px; padding: 7px; border-radius: 34px; background: #0D0D0F; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), var(--sombra-m); }
.gi-pantalla { position: relative; height: 360px; border-radius: 27px; overflow: hidden; background: #F2F2F7; color: #1C1C1E; font-size: 11px; line-height: 1.25; }
.gi-pantalla img { display: block; }
.gi-web { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; background: #fff; }
.gi-url { margin: 30px 12px 8px; padding: 6px 10px; border-radius: 10px; background: #EFEFF4; color: #3A3A3C; font-size: 9.5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-contenido { display: grid; justify-items: center; align-content: start; gap: 8px; padding: 18px 16px; background: #0A0907; color: #F6EFE0; }
.gi-contenido img { width: 54px; height: 54px; border-radius: 50%; }
.gi-contenido b { font-size: 13px; }
.gi-contenido i { width: 100%; height: 7px; border-radius: 4px; background: rgba(246, 239, 224, .18); }
.gi-contenido i.corta { width: 60%; }
.gi-barra { display: flex; justify-content: space-around; padding: 9px 6px 18px; background: #F7F7F9; border-top: 1px solid #DCDCE0; color: #0A7AFF; }
.gi-barra span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; }
.gi-barra svg, .gi-fila svg { width: 18px; height: 18px; }
.gi-btn-compartir { animation: gi-toque1 12s infinite; }
.gi-hoja { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 10px 18px; border-radius: 16px 16px 0 0; background: #F2F2F7; box-shadow: 0 -8px 24px rgba(0, 0, 0, .18); transform: translateY(105%); animation: gi-hoja 12s infinite; display: grid; gap: 6px; }
.gi-hoja-cab, .gi-agregar-app { display: flex; align-items: center; gap: 8px; padding: 4px 4px 8px; }
.gi-hoja-cab img, .gi-agregar-app img { border-radius: 8px; }
.gi-hoja-cab span, .gi-agregar-app span { display: grid; min-width: 0; }
.gi-hoja-cab small, .gi-agregar-app small { color: #8E8E93; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gi-fila { display: flex; align-items: center; justify-content: space-between; flex-direction: row-reverse; padding: 9px 12px; border-radius: 10px; background: #fff; font-size: 11.5px; }
.gi-fila svg { color: #1C1C1E; }
.gi-fila-inicio { animation: gi-toque2 12s infinite; }
.gi-agregar { position: absolute; inset: 0; background: #F2F2F7; opacity: 0; animation: gi-agregar 12s infinite; }
.gi-agregar-cab { display: flex; justify-content: space-between; align-items: center; gap: 4px; padding: 32px 8px 12px; font-size: 9.5px; white-space: nowrap; }
.gi-agregar-cab span { color: #0A7AFF; }
.gi-btn-agregar { font-weight: 700; padding: 3px 6px; border-radius: 6px; animation: gi-toque3 12s infinite; }
.gi-agregar-app { margin: 8px 12px; padding: 10px; border-radius: 12px; background: #fff; }
.gi-inicio { position: absolute; inset: 0; padding: 44px 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 56px; gap: 4px 6px; justify-items: center;
  background: linear-gradient(160deg, #2B3A55, #6B4E71 55%, #C47D5A); opacity: 0; animation: gi-inicio 12s infinite; }
.gi-inicio i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .28); }
.gi-app-nueva { display: grid; justify-items: center; gap: 3px; color: #fff; font-size: 8px; white-space: nowrap; max-width: 100%; transform: scale(0); animation: gi-app 12s infinite; }
.gi-app-nueva img { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }
.gi-dedo { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: rgba(120, 120, 128, .45); border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); opacity: 0; left: 50%; top: 93%; animation: gi-dedo 12s infinite; pointer-events: none; }
.gi-textos { display: grid; text-align: center; font-weight: 700; min-height: 1.5em; }
.gi-textos span { grid-area: 1 / 1; opacity: 0; }
.gi-t1 { animation: gi-t1 12s infinite; } .gi-t2 { animation: gi-t2 12s infinite; } .gi-t3 { animation: gi-t3 12s infinite; } .gi-t4 { animation: gi-t4 12s infinite; }
.pasos-guia { padding-left: 22px; display: grid; gap: 8px; margin-bottom: 14px; }

@keyframes gi-hoja { 0%, 22% { transform: translateY(105%); opacity: 1; } 27%, 51% { transform: translateY(0); opacity: 1; } 52%, 100% { transform: translateY(0); opacity: 0; } }
@keyframes gi-agregar { 0%, 50% { opacity: 0; transform: translateY(14px); } 53%, 74% { opacity: 1; transform: none; } 77%, 100% { opacity: 0; } }
@keyframes gi-inicio { 0%, 74% { opacity: 0; } 77%, 100% { opacity: 1; } }
@keyframes gi-app { 0%, 80% { transform: scale(0); } 85% { transform: scale(1.18); } 89%, 100% { transform: scale(1); } }
@keyframes gi-dedo {
  0%, 6% { opacity: 0; left: 50%; top: 93%; transform: scale(1); }
  10%, 15% { opacity: 1; left: 50%; top: 93%; transform: scale(1); }
  17% { opacity: 1; left: 50%; top: 93%; transform: scale(.75); }
  20% { opacity: 0; left: 50%; top: 93%; transform: scale(1); }
  30% { opacity: 0; left: 45%; top: 87%; }
  36%, 41% { opacity: 1; left: 45%; top: 87%; transform: scale(1); }
  43% { opacity: 1; left: 45%; top: 87%; transform: scale(.75); }
  46% { opacity: 0; left: 45%; top: 87%; transform: scale(1); }
  54% { opacity: 0; left: 86%; top: 11%; }
  60%, 64% { opacity: 1; left: 86%; top: 11%; transform: scale(1); }
  66% { opacity: 1; left: 86%; top: 11%; transform: scale(.75); }
  69%, 100% { opacity: 0; left: 86%; top: 11%; transform: scale(1); }
}
@keyframes gi-toque1 { 0%, 15% { background: transparent; } 17%, 21% { background: rgba(10, 122, 255, .18); } 23%, 100% { background: transparent; } }
@keyframes gi-toque2 { 0%, 41% { background: #fff; } 43%, 50% { background: #DCE9FF; } 52%, 100% { background: #fff; } }
@keyframes gi-toque3 { 0%, 64% { background: transparent; } 66%, 72% { background: rgba(10, 122, 255, .18); } 74%, 100% { background: transparent; } }
@keyframes gi-t1 { 0%, 23% { opacity: 1; } 25%, 100% { opacity: 0; } }
@keyframes gi-t2 { 0%, 24% { opacity: 0; } 26%, 48% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes gi-t3 { 0%, 49% { opacity: 0; } 51%, 73% { opacity: 1; } 75%, 100% { opacity: 0; } }
@keyframes gi-t4 { 0%, 74% { opacity: 0; } 76%, 98% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .guia-ios *, .guia-ios { animation: none !important; }
  .gi-hoja { transform: none; }
  .gi-fila-inicio { background: #DCE9FF; }
  .gi-t2 { opacity: 1; }
}
