/* ==========================================================
   Flujo de reserva pública — Sistema de diseño
   Misma identidad de marca que la landing (charcoal/oro/maroon),
   pero en clave "app" clara y liviana para leer formularios.
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Work+Sans:wght@400;500;600;700&display=swap');

:root {
    --bg: #f7f5f2;
    --surface: #ffffff;
    --border: #e8e3da;
    --text: #1f2430;
    --text-2: #6b6f76;
    --text-3: #9a9da3;
    --gold: #c9a227;
    --gold-soft: #faf3df;
    --maroon: #7a2436;
    --maroon-hover: #661d2c;
    --success: #1f8a4c;
    --success-soft: #e7f6ec;
    --danger: #c0392b;
    --danger-soft: #fbeae8;
    --radius-sm: 10px;
    --radius-md: 14px;
    --shadow-sm: 0 1px 3px rgba(31,36,48,.06);
    --shadow-md: 0 8px 24px rgba(31,36,48,.10);
}

* { box-sizing: border-box; }

body.reservar {
    margin: 0;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at top, rgba(122,36,54,.05), transparent 55%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%237a2436' stroke-opacity='0.05' stroke-width='2'%3E%3Cpath d='M20 20 L45 45 M45 20 L20 45'/%3E%3Ccircle cx='18' cy='18' r='4'/%3E%3Ccircle cx='47' cy='47' r='4'/%3E%3Cpath d='M80 70 h22 M80 76 h22 M80 82 h22 M80 88 h22'/%3E%3C/g%3E%3C/svg%3E");
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Work Sans', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); /* espacio para la barra fija de Continuar */
}

.reservar a { color: inherit; }

.contenedor { max-width: 560px; margin: 0 auto; padding: 0 16px; }

/* ---- Header simple ---- */
.rv-header {
    display: flex; align-items: center; gap: 10px;
    padding: 16px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.rv-header a.volver {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
    text-decoration: none; color: var(--text); flex-shrink: 0;
}
.rv-header__titulo { font-size: 15px; font-weight: 700; }
.rv-header__paso { font-size: 12px; color: var(--text-2); }

/* ---- Barra de progreso con etiquetas ---- */
.rv-progreso {
    display: flex; padding: 14px 16px 0; max-width: 560px; margin: 0 auto; gap: 4px;
}
.rv-progreso__paso { flex: 1; text-align: center; }
.rv-progreso__linea {
    height: 4px; border-radius: 2px; background: var(--border); margin-bottom: 6px; transition: background .2s ease;
}
.rv-progreso__paso.completo .rv-progreso__linea,
.rv-progreso__paso.activo .rv-progreso__linea { background: var(--gold); }
.rv-progreso__etiqueta { font-size: 10px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rv-progreso__paso.activo .rv-progreso__etiqueta { color: var(--maroon); }

/* ---- Resumen fijo (lo ya elegido) ---- */
.rv-resumen {
    max-width: 560px; margin: 14px auto 0; padding: 12px 16px;
    background: var(--gold-soft); border: 1px solid #ecdfb4; border-radius: var(--radius-sm);
    display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin-left: 16px; margin-right: 16px;
}
.rv-resumen strong { color: var(--text); }
.rv-resumen .precio { margin-left: auto; font-weight: 700; color: var(--maroon); }

/* ---- Contenido de cada paso ---- */
.rv-main { padding: 20px 0 20px; animation: rv-fade-in .3s ease; }
@keyframes rv-fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.rv-titulo { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: .01em; margin: 4px 0 4px; }
.rv-subtitulo { color: var(--text-2); font-size: 13.5px; margin: 0 0 20px; }

/* ---- Tarjetas seleccionables (radio oculto + label) ---- */
.rv-opciones { display: flex; flex-direction: column; gap: 10px; }
.rv-opcion { position: relative; }
.rv-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.rv-opcion label {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
    padding: 14px; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.rv-opcion label:hover { border-color: #d8ccb8; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.rv-opcion input:checked + label {
    border-color: var(--maroon); box-shadow: 0 0 0 3px rgba(122,36,54,.10); background: #fdf9f7;
}
.rv-opcion label.rv-seleccionando { animation: rv-select-pulse .32s ease; }
@keyframes rv-select-pulse {
    0% { transform: scale(1); }
    40% { transform: scale(0.96); border-color: var(--maroon); }
    100% { transform: scale(1); }
}
.rv-opcion label:active { transform: scale(0.99); }
.rv-opcion__check {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: border-color .15s ease, background .15s ease;
}
.rv-opcion input:checked + label .rv-opcion__check { border-color: var(--maroon); background: var(--maroon); }
.rv-opcion__check svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity .1s ease; }
.rv-opcion input:checked + label .rv-opcion__check svg { opacity: 1; }

/* ---- Fecha: pastillas en grid ---- */
.rv-fechas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rv-fechas-grid .rv-opcion label {
    flex-direction: column; padding: 12px 4px; text-align: center; gap: 2px;
}
.rv-fechas-grid .dia-num { font-size: 18px; font-weight: 700; }
.rv-fechas-grid .dia-nombre { font-size: 11px; color: var(--text-2); text-transform: uppercase; }
.rv-fechas-grid .rv-opcion__check { display: none; }

/* ---- Empleado: póster vertical premium (9:16) ---- */
.rv-empleados-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.rv-opcion--empleado label {
    flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; gap: 0;
    border: none; border-radius: 18px; background: #1a1c22;
    box-shadow: 0 6px 20px rgba(31,36,48,.12);
    transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
}
.rv-opcion--empleado label:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(31,36,48,.18); }
.rv-opcion--empleado .foto-wrap {
    position: relative; width: 100%; aspect-ratio: 9 / 16; background: #24262d; overflow: hidden;
}
.rv-opcion--empleado .foto-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.rv-opcion--empleado label:hover .foto-wrap img { transform: scale(1.05); }
.rv-opcion--empleado .foto-wrap .sin-foto {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(160deg, #2a2c34, #1a1c22);
    color: var(--gold); font-family: 'Bebas Neue', sans-serif; font-size: 56px;
}
.rv-opcion--empleado .foto-wrap::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.75) 100%);
}
.rv-opcion--empleado .check-flotante {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.9);
    display: flex; align-items: center; justify-content: center; border: none;
    transition: background .15s ease, transform .15s ease;
}
.rv-opcion--empleado .check-flotante svg { width: 15px; height: 15px; color: var(--maroon); opacity: 0; transition: opacity .15s ease; }
.rv-opcion--empleado .info {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
    padding: 12px 12px 14px; color: #fff;
}
.rv-opcion--empleado .nombre { font-weight: 700; font-size: 14.5px; display: block; letter-spacing: .01em; }
.rv-opcion--empleado .especialidad { font-size: 11.5px; color: var(--gold); display: block; margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rv-opcion--empleado label { position: relative; }
.rv-opcion--empleado .foto-wrap { position: relative; }

/* Estado seleccionado: borde dorado + escala + pulso */
.rv-opcion--empleado input:checked + label {
    transform: scale(1.03);
    box-shadow: 0 0 0 3px var(--gold), 0 12px 28px rgba(201,162,39,.25);
}
.rv-opcion--empleado input:checked + label .check-flotante { background: var(--gold); }
.rv-opcion--empleado input:checked + label .check-flotante svg { opacity: 1; color: #1a1305; }
.rv-opcion--empleado label.rv-seleccionando { animation: rv-empleado-pulso .32s ease; }
@keyframes rv-empleado-pulso {
    0% { transform: scale(1.03); }
    45% { transform: scale(0.98); }
    100% { transform: scale(1.03); }
}

/* ---- Servicio: catálogo tipo kiosco ---- */
.rv-servicios-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rv-opcion--servicio label { flex-direction: column; align-items: stretch; padding: 0; overflow: hidden; gap: 0; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.rv-opcion--servicio label:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.rv-opcion--servicio img { width: 100%; height: 100px; object-fit: cover; transition: transform .25s ease; }
.rv-opcion--servicio label:hover img { transform: scale(1.03); }
.rv-opcion--servicio .sin-imagen { width: 100%; height: 100px; background: var(--gold-soft); }
.rv-opcion--servicio .cuerpo { padding: 10px 12px 12px; }
.rv-opcion--servicio .nombre { font-weight: 700; font-size: 13.5px; }
.rv-opcion--servicio .desc { font-size: 11.5px; color: var(--text-2); margin: 3px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rv-opcion--servicio .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.rv-opcion--servicio .precio { color: var(--maroon); font-weight: 700; }
.rv-opcion--servicio .duracion { color: var(--text-3); }
.rv-opcion--servicio .rv-opcion__check { position: absolute; top: 8px; right: 8px; background: #fff; box-shadow: var(--shadow-sm); }

/* ---- Hora: pastillas grandes ---- */
.rv-horas-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rv-horas-grid .rv-opcion label { justify-content: center; padding: 13px 4px; font-weight: 600; font-size: 13.5px; }
.rv-horas-grid .rv-opcion__check { display: none; }

.rv-vacio { text-align: center; padding: 40px 20px; color: var(--text-2); }
.rv-vacio svg { width: 36px; height: 36px; color: var(--text-3); margin-bottom: 10px; }

/* ---- Barra fija de "Continuar" ---- */
.rv-barra-continuar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--border);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -4px 16px rgba(0,0,0,.05);
}
.rv-barra-continuar .contenido { max-width: 560px; margin: 0 auto; }
.rv-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px; background: var(--maroon); color: #fff;
    border: none; border-radius: var(--radius-sm); font-size: 15.5px; font-weight: 700;
    cursor: pointer; font-family: inherit; transition: background .15s ease, transform .1s ease;
}
.rv-btn:hover { background: var(--maroon-hover); }
.rv-btn:active { transform: scale(0.99); }
.rv-btn[disabled] { opacity: .55; cursor: not-allowed; }
.rv-btn .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rv-spin .6s linear infinite; }
.rv-btn.cargando .spinner { display: inline-block; }
.rv-btn.cargando .texto-btn { opacity: .85; }
@keyframes rv-spin { to { transform: rotate(360deg); } }

/* ---- Formulario de datos ---- */
.rv-campo { margin-bottom: 16px; }
.rv-campo label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.rv-campo input {
    width: 100%; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 15px; font-family: inherit; transition: border-color .15s ease;
}
.rv-campo input:focus { outline: none; border-color: var(--maroon); }
.rv-campo input.invalido { border-color: var(--danger); }
.rv-campo .error-campo { display: none; color: var(--danger); font-size: 12px; margin-top: 4px; }
.rv-campo input.invalido + .error-campo { display: block; }

.rv-flash { padding: 11px 14px; border-radius: var(--radius-sm); margin: 12px 16px 0; font-size: 13.5px; }
.rv-flash.error { background: var(--danger-soft); color: var(--danger); }
.rv-flash.success { background: var(--success-soft); color: var(--success); }

/* ---- Confirmación ---- */
.rv-confirmacion { text-align: center; padding: 30px 0 10px; }
.rv-check {
    width: 68px; height: 68px; border-radius: 50%; background: var(--success-soft);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 18px;
    animation: rv-check-pop .4s cubic-bezier(.34,1.56,.64,1);
}
.rv-check svg { width: 34px; height: 34px; color: var(--success); }
@keyframes rv-check-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.rv-confirmacion h1 { font-family: 'Bebas Neue', sans-serif; font-size: 26px; margin: 0 0 6px; }
.rv-confirmacion p.sub { color: var(--text-2); font-size: 13.5px; margin: 0 0 24px; }

.rv-ticket {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 18px; text-align: left; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.rv-ticket__fila { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.rv-ticket__fila:last-child { border-bottom: none; }
.rv-ticket__fila .label { color: var(--text-2); }
.rv-ticket__fila .valor { font-weight: 700; }

.rv-acciones-confirmacion { display: flex; gap: 8px; margin-bottom: 10px; }
.rv-btn-secundario {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px;
    text-decoration: none; cursor: pointer; font-family: inherit;
}
.rv-btn-secundario svg { width: 16px; height: 16px; }
.rv-btn-secundario.whatsapp {
    color: #fff; background: #25d366; border-color: #25d366; font-weight: 700;
    box-shadow: 0 6px 16px rgba(37,211,102,.35);
}
.rv-btn-secundario.whatsapp:hover { background: #1ebd5a; }
.rv-btn-secundario.whatsapp svg { fill: #fff; stroke: none; width: 18px; height: 18px; }

@media (min-width: 640px) {
    .rv-servicios-grid { grid-template-columns: repeat(3, 1fr); }
    .rv-fechas-grid { grid-template-columns: repeat(4, 1fr); }
    .rv-empleados-grid { grid-template-columns: repeat(3, 1fr); }
    .contenedor, .rv-progreso, .rv-resumen, .rv-barra-continuar .contenido { max-width: 640px; }
}
@media (min-width: 900px) {
    .rv-empleados-grid { grid-template-columns: repeat(4, 1fr); }
    body.paso-ancho .contenedor, body.paso-ancho .rv-progreso, body.paso-ancho .rv-resumen { max-width: 860px; }
}
