/* Fuentes servidas desde el propio dominio (OFL 1.1, licencias en /fonts). Nada de Google Fonts. */
@font-face {
  font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/instrument-serif-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Manrope'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('/fonts/manrope-latin.woff2') format('woff2');
}

:root {
  --bg: #12100e;
  --bg-2: #1a1714;
  --card: #1f1b17;
  --line: #2f2a24;
  --line-2: #3d362e;
  --ink: #f3ece1;
  --muted: #a39a8c;
  --dim: #6f675c;
  --brass: #d4a95f;
  --brass-2: #e9c887;
  --red: #c8483b;
  --green: #7fb77e;
  --radius: 16px;
  --display: 'Instrument Serif', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a, label, input { touch-action: manipulation; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }

/* Grano sutil de fondo */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(212,169,95,.12), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(200,72,59,.07), transparent 60%);
}

/* Poste de barbero */
.pole {
  height: 6px; width: 100%;
  background: repeating-linear-gradient(-45deg, var(--red) 0 12px, var(--ink) 12px 24px, #2e4a7d 24px 36px, var(--ink) 36px 48px);
  background-size: 68px 100%;
  animation: pole 3s linear infinite;
}
@keyframes pole { to { background-position: 68px 0; } }

.wrap { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Cabecera ── */
.top { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line-2); color: var(--brass); font-size: 16px;
}
.top-link { color: var(--dim); font-size: 13px; text-decoration: none; }
.top-link:hover { color: var(--muted); }

/* ── Layout principal ── */
.layout { display: grid; grid-template-columns: 1fr 1.25fr; gap: 56px; padding: 40px 0 80px; align-items: start; }
.layout > * { min-width: 0; }
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 16px; } }

.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brass);
}
.hero .eyebrow::before { content: ''; width: 24px; height: 1px; background: var(--brass); }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(48px, 8vw, 88px); line-height: .95; letter-spacing: -.02em; margin: 18px 0 20px;
}
.hero h1 em { color: var(--brass-2); }
.hero p { color: var(--muted); max-width: 38ch; font-size: 16px; }
@media (max-width: 880px) { .hero h1 { margin-bottom: 12px; } }

/* ── Tarjeta de reserva ── */
.card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--line); border-radius: 24px; padding: 28px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.6);
}
@media (max-width: 520px) { .card { padding: 20px; border-radius: 20px; } }

.step { margin-bottom: 28px; }
.step:last-child { margin-bottom: 0; }
.step-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.step-num { font-family: var(--display); color: var(--brass); font-size: 20px; }
.step-title { font-weight: 700; font-size: 15px; }
.step-hint { margin-left: auto; font-size: 12px; color: var(--dim); }

/* Días */
.days { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.day {
  flex: 0 0 76px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg);
  transition: border-color .2s, background .2s, transform .2s;
}
@media (hover: hover) { .day:hover:not(:disabled) { border-color: var(--line-2); transform: translateY(-2px); } }
.day .dw { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.day .dn { font-family: var(--display); font-size: 30px; line-height: 1.1; }
.day .dm { font-size: 11px; color: var(--dim); }
.day.active { border-color: var(--brass); background: rgba(212,169,95,.1); }
.day.active .dn { color: var(--brass-2); }
.day:disabled { opacity: .35; }
.day:disabled .dn { text-decoration: line-through; text-decoration-thickness: 1px; }
.day .tag { font-size: 10px; color: var(--dim); }

/* Horas */
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 520px) { .slots { grid-template-columns: repeat(3, 1fr); } }
.slot {
  padding: 14px 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  font-weight: 600; font-variant-numeric: tabular-nums; transition: all .2s;
}
@media (hover: hover) { .slot:hover:not(:disabled) { border-color: var(--line-2); } }
.slot.active { background: var(--brass); color: #1a1409; border-color: var(--brass); }
.slot:disabled { color: var(--dim); text-decoration: line-through; opacity: .5; }
.empty { color: var(--dim); font-size: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }

/* Nombre */
.field { position: relative; }
.field input {
  width: 100%; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg);
  font-size: 16px; transition: border-color .2s;
}
.field input::placeholder { color: var(--dim); }
.field input:focus { outline: none; border-color: var(--brass); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line);
}
.summary-text { font-size: 14px; color: var(--muted); }
.summary-text b { color: var(--ink); font-weight: 600; }
@media (max-width: 520px) { .summary { flex-direction: column; align-items: stretch; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 26px; border-radius: 999px; background: var(--brass); color: #1a1409;
  font-weight: 700; font-size: 15px; transition: background .2s, transform .15s, opacity .2s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--brass-2); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .35; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--bg-2); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.error { color: #ef8a7e; font-size: 14px; margin-top: 12px; min-height: 1em; }

/* Éxito */
.done { text-align: center; padding: 20px 4px; }
.check {
  width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(212,169,95,.12); border: 1px solid var(--brass);
}
.check svg { width: 32px; height: 32px; stroke: var(--brass-2); stroke-width: 2.5; fill: none; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s .2s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h2 { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.05; margin-bottom: 10px; }
.done p { color: var(--muted); }
.ticket {
  margin: 24px auto; max-width: 320px; padding: 18px; border-radius: 14px;
  border: 1px dashed var(--line-2); background: var(--bg);
}
.ticket .t-day { font-weight: 600; }
.ticket .t-day::first-letter { text-transform: uppercase; }
.ticket .t-time { font-family: var(--display); font-size: 44px; color: var(--brass-2); line-height: 1.1; }

.fade-in { animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.skeleton { height: 90px; border-radius: 14px; background: linear-gradient(90deg, var(--bg) 25%, var(--bg-2) 50%, var(--bg) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

footer { position: relative; z-index: 1; text-align: center; color: var(--dim); font-size: 12px; padding: 0 0 32px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .check svg { stroke-dashoffset: 0; }
}

/* ── Móvil ── */
@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .top { padding: 16px 0; }
  .layout { gap: 20px; padding: 4px 0 32px; }
  .hero .eyebrow { font-size: 11px; }
  .hero h1 { font-size: 44px; margin: 10px 0 8px; }
  .hero p { font-size: 15px; }

  .card { padding: 18px 14px 0; border-radius: 20px; }
  .step { margin-bottom: 22px; }
  .step-head { margin-bottom: 12px; }

  /* Días: sin barra de scroll y con aviso de que hay más a la derecha */
  .days {
    margin: 0 -14px; padding: 2px 14px 4px; gap: 8px; scroll-padding: 0 14px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
            mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .days::-webkit-scrollbar { display: none; }
  .day { flex-basis: 68px; padding: 10px 4px; }
  .day .dn { font-size: 28px; }

  .slots { gap: 8px; }
  .slot { padding: 15px 0; font-size: 16px; }

  /* Botón de reservar siempre a mano, pegado abajo */
  .summary {
    position: sticky; bottom: 0; z-index: 5;
    flex-direction: column; align-items: stretch; gap: 10px;
    margin: 18px -14px 0; padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    background: rgba(26,23,20,.92);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); border-radius: 0 0 20px 20px;
  }
  .summary-text { text-align: center; }
  .summary .btn { width: 100%; padding: 16px; font-size: 16px; }
  .error:empty { display: none; }
  .error { margin: 0 0 14px; text-align: center; }

  .done { padding: 12px 0 22px; }
  .done h2 { font-size: 34px; }
}

@media (max-width: 360px) {
  .hero h1 { font-size: 38px; }
  .slot { font-size: 15px; padding: 13px 0; }
}

/* Utilidades (sustituyen a los style="" en línea, que la CSP no permite) */
.flex-1 { flex: 1; }
.m-0 { margin: 0; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-22 { margin-top: 22px; }
.mb-10 { margin-bottom: 10px; }
.pb-80 { padding-bottom: 80px; }
.maxw-360 { max-width: 360px; }
.top-actions { display: flex; gap: 8px; }
.text-dim { color: var(--dim); }

/* Consentimiento e información de privacidad bajo el formulario */
.consent { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 14px; color: var(--ink); cursor: pointer; }
.consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brass); }
.consent a, .privacy-info a, .legal a, footer a { color: var(--brass-2); }
.privacy-info { margin-top: 12px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.privacy-info dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 6px; }
.privacy-info dt { font-weight: 600; color: var(--ink); }
footer .sep { margin: 0 6px; }

/* Páginas legales */
.legal { max-width: 760px; margin: 0 auto; padding: 24px 0 56px; }
.legal h1 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 6vw, 56px); line-height: 1; margin-bottom: 18px; }
.legal h2 { font-size: 17px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.legal ul { padding-left: 20px; }
.legal strong { color: var(--ink); }
.placeholder { background: rgba(239,138,126,.15); color: #ef8a7e; border: 1px dashed #ef8a7e; border-radius: 6px; padding: 1px 6px; font-weight: 700; }
