/* ==========================================================================
   Limoncello Reservas · Formulario público
   Diseñado primero para celular. Colores tomados del logo (beige #BBAF95).
   Sin librerías ni fuentes externas (la CSP solo permite recursos propios).
   ========================================================================== */

:root {
    --ink: #2b2621;          /* texto y fondos oscuros */
    --ink-soft: #5d554b;
    --muted: #7a7064;
    --beige: #bbaf95;        /* color del logo */
    --beige-deep: #8d7f63;   /* beige legible sobre claro */
    --beige-soft: #efe9dd;
    --cream: #faf7f2;
    --surface: #ffffff;
    --line: #e6dfd2;
    --ok: #2f6b43;
    --ok-bg: #eaf4ed;
    --err: #a4281c;
    --err-bg: #fbecea;
    --warn-bg: #fbf4e3;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(43, 38, 33, .05), 0 8px 24px rgba(43, 38, 33, .06);
    --serif: Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pub {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--cream); color: var(--ink);
    font-family: var(--sans); font-size: 16px; line-height: 1.5;
}
body.pub.is-embed { background: transparent; min-height: 0; }
a { color: var(--ink); }
.muted { color: var(--muted); }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Cabecera con logo ---------- */
.pub-header {
    background: var(--ink); display: flex; justify-content: center; align-items: center;
    padding: 18px 16px calc(18px + env(safe-area-inset-top, 0));
}
.pub-header__logo { display: block; line-height: 0; }
.pub-header__logo img { width: 190px; max-width: 60vw; height: auto; }

.pub-main { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 24px 16px 40px; }
.is-embed .pub-main { padding: 8px 12px 16px; }

.pub-footer { text-align: center; padding: 20px 16px 28px; color: var(--muted); font-size: 14px; }
.pub-footer a, .pub-embed-links a { color: var(--ink-soft); }
.pub-footer span { margin: 0 8px; }
.pub-embed-links { text-align: center; font-size: 13px; color: var(--muted); margin: 0 0 8px; }

/* ---------- Introducción ---------- */
.booking__intro { text-align: center; margin-bottom: 18px; }
.booking__title { font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .01em; margin: 0 0 6px; }
.booking__subtitle { color: var(--ink-soft); margin: 0; font-size: 15px; }

/* ---------- Progreso ---------- */
.progress { list-style: none; display: flex; justify-content: space-between; gap: 4px; padding: 0; margin: 0 0 18px; }
.progress__item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; position: relative; }
.progress__item::before {
    content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0;
}
.progress__item:first-child::before { display: none; }
.progress__dot {
    width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface); border: 2px solid var(--line); font-weight: 600; font-size: 13px; position: relative; z-index: 1;
}
.progress__item.is-done { color: var(--ink-soft); }
.progress__item.is-done .progress__dot { background: var(--beige); border-color: var(--beige); color: var(--ink); }
.progress__item.is-done::before, .progress__item.is-current::before { background: var(--beige); }
.progress__item.is-current { color: var(--ink); font-weight: 600; }
.progress__item.is-current .progress__dot { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Tarjeta y pasos ---------- */
.card-pub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px; }
.is-embed .card-pub { box-shadow: none; }
.step { border: 0; margin: 0; padding: 0; min-width: 0; }
.step__title { font-family: var(--serif); font-size: 22px; font-weight: 400; margin: 0 0 16px; padding: 0; }
.step__title span { display: block; font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--beige-deep); font-weight: 700; margin-bottom: 2px; }
.step__context { color: var(--ink-soft); margin: -8px 0 14px; font-size: 15px; }

/* ---------- Opciones (sede) ---------- */
.choice-list { display: grid; gap: 10px; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__body {
    display: block; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px;
    transition: border-color .15s, background .15s;
}
.choice__body strong { display: block; font-size: 17px; }
.choice__body small { color: var(--muted); font-size: 14px; }
.choice:hover .choice__body { border-color: var(--beige); }
.choice input:checked + .choice__body { border-color: var(--ink); background: var(--beige-soft); }
.choice input:focus-visible + .choice__body { outline: 3px solid var(--beige); outline-offset: 2px; }

/* ---------- Calendario ---------- */
.calendar__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.calendar__month { margin: 0; font-weight: 600; font-size: 17px; text-transform: capitalize; }
.icon-button {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
    font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink);
}
.icon-button:disabled { opacity: .35; cursor: default; }
.calendar__weekdays, .calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.calendar__weekdays { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.day {
    aspect-ratio: 1; min-height: 40px; border: 0; border-radius: 50%; background: transparent; font: inherit; font-size: 15px;
    color: #b7ad9f; cursor: default; display: grid; place-items: center; position: relative;
}
.day--open { color: var(--ink); cursor: pointer; background: var(--beige-soft); font-weight: 600; }
.day--open:hover { background: var(--beige); }
.day--selected, .day--selected:hover { background: var(--ink); color: #fff; }
.day--today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.day--blocked { text-decoration: line-through; }
.day:focus-visible { outline: 3px solid var(--beige); outline-offset: 1px; }
.calendar__legend { font-size: 13px; color: var(--muted); margin: 12px 0 0; display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; justify-content: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: -8px; }
.dot--open { background: var(--beige-soft); border: 1px solid var(--beige); }
.dot--off { background: transparent; border: 1px solid #cfc6b8; }

/* ---------- Personas ---------- */
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 8px 0 10px; }
.stepper__btn {
    width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--surface);
    font-size: 28px; line-height: 1; cursor: pointer; color: var(--ink);
}
.stepper__btn:disabled { opacity: .3; cursor: default; }
.stepper__value { font-family: var(--serif); font-size: 48px; min-width: 70px; text-align: center; }

/* ---------- Horas ---------- */
.slot-group { margin-bottom: 14px; }
.slot-group__title { font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--beige-deep); font-weight: 700; margin: 0 0 8px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.slot {
    min-height: 48px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
    font: inherit; font-weight: 600; cursor: pointer; color: var(--ink);
}
.slot:hover { border-color: var(--beige); }
.slot[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.slot:focus-visible { outline: 3px solid var(--beige); outline-offset: 2px; }
.loading { color: var(--muted); text-align: center; padding: 18px 0; }

/* ---------- Campos ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.optional { font-weight: 400; color: var(--muted); }
.field input[type="text"], .field input[type="tel"], .field input[type="email"], .field textarea {
    width: 100%; font: inherit; font-size: 16px; /* 16px evita el zoom automático en iPhone */
    padding: 12px 14px; border: 1.5px solid #d8cfbf; border-radius: var(--radius-sm); background: #fff; color: var(--ink); min-height: 50px;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(187, 175, 149, .45); }
.field.has-error input, .field.has-error textarea { border-color: var(--err); }
.field__error { color: var(--err); font-size: 14px; margin: 6px 0 0; }
.field__error:empty { display: none; }
.hint { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.check-pub { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; font-size: 15px; cursor: pointer; }
.check-pub input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--ink); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Resumen ---------- */
.summary { margin: 0 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.summary dt { color: var(--muted); font-size: 14px; }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Botones ---------- */
.actions { display: flex; gap: 10px; justify-content: space-between; margin-top: 22px; }
.actions--center { justify-content: center; }
.btn-pub {
    min-height: 52px; padding: 0 22px; border-radius: 999px; font: inherit; font-weight: 700; font-size: 16px;
    cursor: pointer; border: 1.5px solid transparent;
}
.btn-pub--primary { background: var(--ink); color: #fff; flex: 1; }
.btn-pub--primary:hover:not(:disabled) { background: #3d362f; }
.btn-pub--primary:disabled { background: #c9c0b2; cursor: default; }
.btn-pub--ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-pub--block { width: 100%; }
.btn-pub:focus-visible { outline: 3px solid var(--beige); outline-offset: 2px; }

/* ---------- Avisos ---------- */
.notice { border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 14px; background: var(--warn-bg); border: 1px solid #efdfb3; font-size: 15px; }
.notice--error { background: var(--err-bg); border-color: #f1c7c1; color: var(--err); }
.notice--ok { background: var(--ok-bg); border-color: #c5e1cd; color: var(--ok); }
.notice strong { display: block; margin-bottom: 4px; }
.notice ul { margin: 8px 0 0; padding-left: 18px; }
.notice a { color: inherit; font-weight: 600; }
.empty { text-align: center; padding: 10px 0 4px; }
.empty p { margin: 0 0 6px; }

/* ---------- Éxito ---------- */
.success { text-align: center; }
.success__icon { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 12px; display: grid; place-items: center; background: var(--beige); color: var(--ink); font-size: 30px; font-weight: 700; }
.success__title { font-family: var(--serif); font-weight: 400; font-size: 24px; margin: 0 0 14px; }
.success__code-label { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
.success__code { font-size: 32px; font-weight: 700; letter-spacing: .04em; margin: 2px 0 18px; }
.success .summary { text-align: left; max-width: 360px; margin: 0 auto 12px; }

/* ---------- Pantallas grandes ---------- */
@media (min-width: 640px) {
    .card-pub { padding: 30px 32px; }
    .booking__title { font-size: 36px; }
    .choice-list { grid-template-columns: 1fr 1fr; }
    .progress__item { font-size: 13px; }
}
@media (max-width: 380px) {
    .progress__label { display: none; }
    .booking__title { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
