/* Portal de reservas Toppin: tema oscuro de la app principal (bg #151412, acento #1CBD87, Inter).
   Mobile-first, sin dependencias. Las clases y los IDs los usan restaurante.html, gestionar.html y los scripts. */
:root {
    --bg: #151412;
    --bg-2: #1B1A17;
    --card: #1F1E1B;
    --card-2: #262420;
    --border: #332F2A;
    --border-2: #433E37;
    --text: #F2F0EC;
    --muted: #9A9691;
    --accent: #1CBD87;
    --accent-hover: #17A376;
    --accent-soft: rgba(28, 189, 135, 0.14);
    --ok: #2F9E5C;
    --ok-soft: rgba(47, 158, 92, 0.16);
    --warn: #E0A020;
    --warn-soft: rgba(224, 160, 32, 0.16);
    --danger: #D64545;
    --danger-soft: rgba(214, 69, 69, 0.16);
    --info: #3E8EDE;
    --info-soft: rgba(62, 142, 222, 0.16);
    --r-card: 12px;
    --r-btn: 10px;
    --r-input: 9px;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-accent: 0 0 15px rgba(28, 189, 135, 0.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
    margin: 0;
    background:
        radial-gradient(1200px 500px at 50% -200px, rgba(28, 189, 135, 0.10), transparent 70%),
        var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    min-height: 100%;
}

::selection { background: var(--accent-soft); }

/* ---------- Estructura ---------- */
.contenedor {
    max-width: 520px;
    margin: 0 auto;
    padding: 16px 16px 48px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(48px, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.marca {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 2px 0;
}
.marca img {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: block;
    box-shadow: var(--shadow-accent);
}
.marca span {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.marca small {
    margin-left: auto;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

h1, h2 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
p { margin: 0; }

.cabecera-restaurante {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 2px 0;
}
.etiqueta {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
}
.texto-suave { color: var(--muted); font-size: 14px; }
.cabecera-restaurante .texto-suave { margin-top: 2px; }

/* ---------- Tarjetas ---------- */
.tarjeta {
    background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 60%);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.paso { display: flex; flex-direction: column; gap: 12px; }
.paso + .paso { border-top: 1px solid var(--border); padding-top: 20px; }

/* ---------- Avisos ---------- */
.aviso {
    border-radius: var(--r-btn);
    padding: 12px 14px;
    font-size: 14px;
    border: 1px solid transparent;
}
.aviso-error { background: var(--danger-soft); color: #FF8A8A; border-color: rgba(214, 69, 69, 0.35); }
.aviso-ok { background: var(--ok-soft); color: #7FDDA6; border-color: rgba(47, 158, 92, 0.35); }
.aviso-aviso { background: var(--warn-soft); color: #F5C35C; border-color: rgba(224, 160, 32, 0.35); }

/* ---------- Comensales ---------- */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--r-card);
    padding: 10px;
}
.stepper-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border-2);
    background: var(--card-2);
    color: var(--text);
    font: inherit;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s, border-color .15s, transform .1s;
}
.stepper-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.stepper-btn:active:not(:disabled) { transform: scale(0.94); }
.stepper-btn:disabled { opacity: 0.3; cursor: default; }
output {
    font-size: 28px;
    font-weight: 700;
    min-width: 3ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
output::after { content: ' personas'; font-size: 13px; font-weight: 500; color: var(--muted); }

/* ---------- Calendario ---------- */
.cal-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.cal-titulo { font-weight: 600; font-size: 15px; text-transform: capitalize; }
.cal-nav {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: var(--card-2);
    color: var(--text);
    border-radius: var(--r-btn);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.cal-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.cal-nav:disabled { opacity: 0.25; cursor: default; }
.cal-rejilla { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dia-semana {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    padding: 4px 0;
    text-transform: uppercase;
}
.cal-dia {
    aspect-ratio: 1;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 50%;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s, color .15s;
}
.cal-dia:hover:not(:disabled) { background: var(--card-2); }
.cal-dia:disabled { color: #4A463F; cursor: default; }
.cal-hoy { border-color: var(--border-2); }
.cal-seleccionada,
.cal-seleccionada:hover { background: var(--accent) !important; color: #06150F; font-weight: 700; border-color: var(--accent); box-shadow: var(--shadow-accent); }

/* ---------- Horas ---------- */
.horas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
}
.hora {
    padding: 11px 6px;
    border-radius: var(--r-input);
    border: 1px solid var(--border-2);
    background: var(--bg-2);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .15s, background .15s, color .15s;
}
.hora:hover { border-color: var(--accent); }
.hora-activa,
.hora-activa:hover { background: var(--accent); border-color: var(--accent); color: #06150F; font-weight: 700; box-shadow: var(--shadow-accent); }
.hora-actual { border-color: var(--info); color: #9CC8F5; }

/* ---------- Formulario ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.campo > span:first-child { color: var(--text); }
.campo input,
.campo textarea {
    font: inherit;
    font-size: 16px; /* evita el zoom automático de iOS */
    color: var(--text);
    padding: 12px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-input);
    background: var(--bg-2);
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.campo textarea { resize: vertical; min-height: 60px; }
.campo input::placeholder,
.campo textarea::placeholder { color: #5E5A53; }
.campo input:focus,
.campo textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.campo small { font-size: 12px; color: var(--muted); }

/* ---------- Botones ---------- */
.boton {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    text-decoration: none;
    padding: 13px 18px;
    border-radius: var(--r-btn);
    border: 1px solid transparent;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    touch-action: manipulation;
    transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.boton:active:not(:disabled) { transform: scale(0.98); }
.boton:disabled { opacity: 0.45; cursor: default; }
.boton-principal {
    background: var(--accent);
    color: #06150F;
    box-shadow: var(--shadow-accent);
}
.boton-principal:hover:not(:disabled) { background: var(--accent-hover); }
.boton-secundario {
    background: var(--card-2);
    color: var(--text);
    border-color: var(--border-2);
}
.boton-secundario:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.boton-peligro {
    background: transparent;
    color: #FF8A8A;
    border-color: rgba(214, 69, 69, 0.45);
}
.boton-peligro:hover:not(:disabled) { background: var(--danger-soft); border-color: var(--danger); }
.acciones { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Detalle de la reserva ---------- */
.datos {
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--r-btn);
    overflow: hidden;
    background: var(--bg-2);
}
.datos div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}
.datos div:nth-child(odd) { border-right: 1px solid var(--border); }
.datos div:nth-last-child(-n+2) { border-bottom: none; }
.datos dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; }
.datos dd { margin: 0; font-weight: 600; font-size: 15px; text-transform: capitalize; }

/* Estados (mismos colores que la app: confirmada/ocupada/reservada/...) */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    background: var(--warn-soft);
    color: #F5C35C;
    border: 1px solid rgba(224, 160, 32, 0.35);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill[data-estado="Confirmada"],
.pill[data-estado="Reconfirmada"] { background: var(--ok-soft); color: #7FDDA6; border-color: rgba(47, 158, 92, 0.4); }
.pill[data-estado="Cancelada"],
.pill[data-estado="No-show"] { background: var(--danger-soft); color: #FF8A8A; border-color: rgba(214, 69, 69, 0.4); }
.pill[data-estado="Sentados"] { background: var(--info-soft); color: #9CC8F5; border-color: rgba(62, 142, 222, 0.4); }
.pill[data-estado="Finalizada"] { background: rgba(154, 150, 145, 0.14); color: var(--muted); border-color: var(--border-2); }

.resumen { font-size: 16px; line-height: 1.5; }
.resultado { text-align: left; }
.resultado h2 { color: var(--accent); margin-bottom: 4px; }

/* Estado de carga */
.cargando {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    padding: 24px 0;
}
.cargando::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border-2);
    border-top-color: var(--accent);
    animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

@media (min-width: 560px) {
    .contenedor { padding-top: 32px; }
    .acciones { flex-direction: row; }
    .acciones .boton { flex: 1; }
    .tarjeta { padding: 24px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
