/* ============================================================
   LOYALTY BEAUTY BAR — Estilos "Nude Elegance"
   Paleta: crema / terracota / salvia. Tipos: Lora + Raleway.
   ============================================================ */

:root {
    --nude-bg: #FBF7F3;
    --nude-bg-2: #F5EFE9;
    --nude-surface: #FFFFFF;
    --nude-surface-rgb: 255, 255, 255;
    --nude-primary: #C0876A;
    --nude-primary-dark: #A97050;
    --nude-accent: #A8C5B9;
    --nude-text: #4A4640;
    --nude-muted: #9CA3AF;
    --nude-border: #ECE3D8;
    --nude-border-rgb: 236, 227, 216;
    --nude-card-dark: #2F2A26;
    --nude-card-mid: #4A4640;
    --nude-card-light: #6B5D52;
}

/* Dark mode: mismos tokens, valores adaptados para fondo oscuro cálido */
@media (prefers-color-scheme: dark) {
    :root {
        --nude-bg: #201D1A;
        --nude-bg-2: #171513;
        --nude-surface: #2A2622;
        --nude-surface-rgb: 42, 38, 34;
        --nude-primary: #D39B7C;
        --nude-primary-dark: #C0876A;
        --nude-accent: #A8C5B9;
        --nude-text: #F1EAE2;
        --nude-muted: #A79E92;
        --nude-border: #3B3530;
        --nude-border-rgb: 59, 53, 48;
    }
    .field input { color: var(--nude-text); }
    .member-code { color: var(--nude-text); }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    max-width: 100%;
    overflow-x: hidden;
}
img, canvas, svg { max-width: 100%; height: auto; }

/* Transición nativa entre páginas (evita el flash en blanco durante la
   navegación mientras MySQL responde) — soportado en Chrome/Edge/Safari 18+,
   se degrada a navegación normal donde no exista soporte. */
@view-transition {
    navigation: auto;
}
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 220ms;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}
@media (prefers-reduced-motion: reduce) {
    @view-transition { navigation: none; }
}

body {
    font-family: 'Raleway', system-ui, -apple-system, sans-serif;
    background: var(--nude-bg);
    color: var(--nude-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand-name, .premium-name {
    font-family: 'Lora', Georgia, serif;
    font-weight: 600;
}

/* Fondo con gradiente sutil */
.nude-bg {
    background:
        radial-gradient(1200px 400px at 50% -80px, rgba(168, 197, 185, 0.18), transparent 70%),
        linear-gradient(180deg, var(--nude-bg), var(--nude-bg-2));
}

.app-wrap {
    width: 100%;
    max-width: 28rem;
    min-width: 0;
    margin: 0 auto;
    padding: max(1.25rem, env(safe-area-inset-top))
             max(1rem, env(safe-area-inset-right))
             max(2.5rem, calc(env(safe-area-inset-bottom) + 1.5rem))
             max(1rem, env(safe-area-inset-left));
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
/* Flexbox no encoge un hijo por debajo de su contenido intrínseco (min-content)
   a menos que se le diga explícitamente — sin esto, un texto largo dentro de
   .premium-card/.stack empuja .app-wrap más allá de su max-width y todo el
   layout se desplaza/corta en viewports angostos. */
.app-wrap > * { min-width: 0; }

/* ---------- HERO DE MARCA (logo animado — único protagonista) ----------
   El logo es un wordmark horizontal (ratio real ≈ 3:2), no un ícono
   cuadrado — el contenedor respeta ese ratio para que nunca se recorte
   ni se distorsione. Es el único elemento del hero: sin título ni
   subtítulo duplicando lo que el propio wordmark ya dice.

   Animación (apple-design §4, §12): entrada críticamente amortiguada
   — sin overshoot, porque no hay gesto de usuario que justifique rebote
   — combinada con "materialize" (blur que se resuelve + micro-scale),
   para que el logo se sienta como un objeto que enfoca, no un elemento
   que solo aparece. */
.hero {
    text-align: center;
    padding: 3rem 0 2.25rem;
}
.hero-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(78vw, 22rem);
    margin: 0 auto;
}
.hero-logo img.logo-anim {
    width: 100%;
    height: auto;
    display: block;
    animation: logo-materialize 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes logo-materialize {
    0%   { opacity: 0; filter: blur(10px); transform: scale(0.94); }
    60%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; filter: blur(0); transform: scale(1); }
}

/* Respeto a reduced-motion (apple-design §14): cross-fade corto, sin blur ni escala */
@media (prefers-reduced-motion: reduce) {
    .hero-logo img.logo-anim {
        animation: logo-fade-only 260ms ease both;
    }
}
@keyframes logo-fade-only {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

/* Hero compacto (tarjeta) — mismo panel oscuro editorial que auth-visual
   (registro/login), para que el encabezado de la tarjeta en el celular
   tenga la misma presencia que el panel de marca en escritorio. */
.hero-compact {
    padding: 1.75rem 1.5rem 1.5rem;
    margin-bottom: 1rem;
    border-radius: 1.5rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(192, 135, 106, 0.25);
    background:
        radial-gradient(800px 500px at 20% 20%, rgba(168,197,185,0.22), transparent 60%),
        linear-gradient(135deg, var(--nude-card-dark), var(--nude-card-mid) 60%, var(--nude-card-light));
}
.hero-compact .hero-logo { width: min(58vw, 14rem); }
/* Sobre el fondo oscuro, el aro del medallón se ve como luz atrapando el material */
.hero-compact .auth-medallion {
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 12px 32px rgba(0,0,0,0.28);
}

/* ============================================================
   AUTH SHELL — layout editorial de dos columnas (registro/login)
   Mismo patrón que el CRM (beautybar.lottuzdev.com): panel oscuro
   con mensaje de marca a la izquierda, formulario en tarjeta clara
   a la derecha. En pantallas angostas colapsa a una sola columna.
   ============================================================ */
.auth-body {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(900px 400px at 90% -50px, rgba(192,135,106,0.14), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(168,197,185,0.18), transparent 60%),
        linear-gradient(160deg, var(--nude-bg), var(--nude-bg-2));
}
.auth-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
}
.auth-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 4rem;
    color: #fff;
    background:
        radial-gradient(800px 500px at 20% 20%, rgba(168,197,185,0.22), transparent 60%),
        linear-gradient(135deg, var(--nude-card-dark), var(--nude-card-mid) 60%, var(--nude-card-light));
    overflow: hidden;
}

/* Medallón circular animado — contiene el wordmark completo sin recortarlo
   (object-fit: contain), con un aro sutil de marca alrededor. Más grande y
   con menos padding interno para que el logo llene el círculo (feedback:
   "debe ocupar más espacio, sin espacios en blanco"). */
.auth-medallion {
    width: 7.5rem;
    height: 7.5rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(var(--nude-border-rgb), 0.9);
    box-shadow: 0 12px 32px rgba(0,0,0,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    flex-shrink: 0;
    animation: medallion-materialize 900ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
/* Sobre el panel oscuro de auth-visual, el aro se ve como luz atrapando el material */
.auth-visual .auth-medallion {
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 12px 32px rgba(0,0,0,0.28);
}
.auth-medallion img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Animación de carga más notoria: mayor recorrido de escala + blur más
   perceptible, para que el logo "enfoque" con presencia al entrar. */
@keyframes medallion-materialize {
    0%   { opacity: 0; filter: blur(14px); transform: scale(0.6); }
    55%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; filter: blur(0); transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .auth-medallion { animation: logo-fade-only 260ms ease both; }
}

.auth-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 3rem; }
.auth-brand-name { color: #fff; font-family: 'Lora', Georgia, serif; font-size: 1.2rem; font-weight: 600; }
.auth-quote { position: relative; z-index: 1; }
.auth-eyebrow {
    text-transform: uppercase; letter-spacing: 0.25em; font-size: 0.7rem;
    color: var(--nude-accent); font-weight: 600; margin-bottom: 1rem;
}
.auth-quote h1 { font-family: 'Lora', Georgia, serif; font-size: 2.75rem; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 1.2rem; color: #fff; }
.auth-sub { color: rgba(255,255,255,0.7); max-width: 24rem; font-size: 1rem; font-weight: 300; }
.auth-dots { position: absolute; bottom: 2rem; right: 3rem; display: flex; gap: 0.5rem; }
.auth-dots span { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: rgba(255,255,255,0.35); }
.auth-dots span:nth-child(2) { background: var(--nude-accent); }

.auth-form-col {
    display: flex; align-items: center; justify-content: center;
    padding: 2rem max(1.5rem, env(safe-area-inset-right)) 2rem max(1.5rem, env(safe-area-inset-left));
}
.auth-card {
    width: 100%; max-width: 24rem;
    background: rgba(var(--nude-surface-rgb), 0.85);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(var(--nude-border-rgb), 0.9);
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 18px 40px rgba(74,70,64,0.08);
    animation: card-rise 620ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
}
@media (max-width: 400px) {
    .auth-card { padding: 1.5rem; }
}
.auth-card-head { margin-bottom: 1.75rem; text-align: center; }
.auth-card-head h2 { font-family: 'Lora', Georgia, serif; font-size: 1.6rem; margin-bottom: 0.25rem; color: var(--nude-text); }
.auth-card-head p { color: var(--nude-muted); font-size: 0.9rem; }
.auth-foot { margin-top: 1.75rem; text-align: center; color: var(--nude-muted); font-size: 0.75rem; }

/* Medallón compacto para el móvil de una sola columna (login personal,
   registro público). Antes era un círculo suelto sobre fondo transparente —
   perdía por completo el panel oscuro con degradado premium que sí se ve en
   escritorio (.auth-visual). Ahora reusa el mismo degradado que ya usa la
   tarjeta en su encabezado móvil (.hero-compact, mismos tokens
   --nude-card-dark/mid/light) para que el login/registro tenga la misma
   presencia "premium" en el celular que la tarjeta ya tiene. */
.auth-mobile-medallion {
    display: none;
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 1.5rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(192, 135, 106, 0.25);
    background:
        radial-gradient(800px 500px at 20% 20%, rgba(168,197,185,0.22), transparent 60%),
        linear-gradient(135deg, var(--nude-card-dark), var(--nude-card-mid) 60%, var(--nude-card-light));
}
.auth-mobile-medallion .auth-medallion {
    margin: 0 auto 0.9rem;
    border-color: rgba(255,255,255,0.22);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 12px 32px rgba(0,0,0,0.28);
}

@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
    .auth-mobile-medallion { display: block; }
}

/* Entrada de la tarjeta premium (una secuencia autorada) */
.card-entrance {
    animation: card-rise 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes card-rise {
    0%   { opacity: 0; transform: translateY(18px) scale(0.985); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.premium-card .rewards-line-fill {
    transition: width 1.1s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-reduced-motion: reduce) {
    .card-entrance { animation: none !important; opacity: 1 !important; }
    .premium-card .rewards-line-fill { transition: none !important; }
}

/* ---------- Header ---------- */
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0 1.5rem;
}
.brand-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: var(--nude-surface);
    border: 1px solid var(--nude-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.brand-mark {
    font-family: 'Lora', serif;
    color: var(--nude-primary);
    font-size: 1.25rem;
    font-weight: 600;
}
.brand-name {
    font-size: 1.15rem;
    color: var(--nude-text);
}

/* ---------- Card base (material translúcido estilo Apple) ---------- */
.card {
    background: rgba(var(--nude-surface-rgb), 0.72);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(var(--nude-surface-rgb), 0.65);
    border-top-color: rgba(255,255,255,0.55);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 18px 40px rgba(74,70,64,0.08);
}
@media (prefers-color-scheme: dark) {
    .card { border-top-color: rgba(255,255,255,0.16); }
}
/* Material real: el borde superior más claro lee como luz atrapándose en
   el canto del vidrio (apple-design §12), no solo un borde parejo. */
.card.glass h2 { font-size: 1.45rem; color: var(--nude-text); margin-bottom: 0.4rem; }
.card h1 { font-size: 1.5rem; color: var(--nude-text); margin-bottom: 0.4rem; }
.subtle { color: var(--nude-muted); font-size: 0.9rem; line-height: 1.5; margin-bottom: 1.25rem; }
.tiny { color: var(--nude-muted); font-size: 0.72rem; margin-top: 0.75rem; line-height: 1.4; }
.center { text-align: center; }
.link { color: var(--nude-primary); font-size: 0.85rem; text-decoration: none; font-weight: 600; }
.link:hover { text-decoration: underline; }
.primary-text { color: var(--nude-primary); }

/* ---------- Alertas ---------- */
.alert {
    background: #FEF2F2;
    color: #B91C1C;
    border: 1px solid #FECACA;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ---------- Cookie Banner ---------- */
/* Tarjeta flotante centrada (no una barra pegada de pared a pared) — mismo
   lenguaje visual que el resto de tarjetas (radio 1.25rem, sombra cálida
   suave) en vez de una barra genérica de plantilla. */
.cookie-banner {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 32rem;
    width: calc(100% - 2rem);
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: 1.25rem;
    box-shadow: 0 8px 24px rgba(74,70,64,0.18);
    z-index: 1000;
    border: 1px solid var(--nude-border);
    text-align: left;
}
/* Color FIJO (no var(--nude-text)) a propósito: el fondo de esta tarjeta es
   blanco fijo sin importar el tema del sistema — si usara la variable, en
   modo oscuro pasa a un tono claro pensado para fondos oscuros (#F1EAE2) y
   el texto queda casi ilegible sobre este fondo blanco. Bug real encontrado
   en producción: el texto se veía prácticamente invisible en modo oscuro. */
.cookie-banner p { font-size: 0.85rem; color: #4A4640; margin-bottom: 1rem; }
.cookie-actions { display: flex; gap: 0.5rem; justify-content: flex-end; }
.btn-small { padding: 0.5rem 1rem; font-size: 0.8rem; }
.btn-outline { background: transparent; border: 1px solid var(--nude-primary); color: var(--nude-primary); }

/* ---------- Tipo de identificación (radio pills) ---------- */
.tipo-id {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.4rem;
    margin-bottom: 0.25rem;
    width: 100%;
}
/* Variante de 2 opciones (Cédula/Pasaporte, sin RUC) — columnas más anchas */
.tipo-id.tipo-id-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tipo-id-opt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    border: 1px solid var(--nude-border);
    border-radius: 999px;
    padding: 0.55rem 0.2rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--nude-muted);
    cursor: pointer;
    transition: all .15s;
    min-width: 0;
}
.tipo-id-opt span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tipo-id-opt input[type="radio"] {
    flex-shrink: 0;
    width: 0.9rem;
    height: 0.9rem;
}
@media (max-width: 360px) {
    .tipo-id-opt { font-size: 0.7rem; padding: 0.5rem 0.15rem; gap: 0.2rem; }
}
.tipo-id-opt:has(input:checked) {
    background: var(--nude-primary);
    border-color: var(--nude-primary);
    color: #fff;
}
.tipo-id-opt input { accent-color: var(--nude-primary); }

/* ---------- Formulario ---------- */
.form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field span {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nude-muted);
}
/* :not(checkbox/radio) — mismo bug que crm/assets.css: sin esto, un
   checkbox/radio anidado dentro de un .field se vuelve una caja gigante en
   vez de un checkbox normal (encontrado en producción el 2026-08-23). No
   hay ningún checkbox así hoy en loyalty/, pero se deja igual de defendido. */
.field input:not([type="checkbox"]):not([type="radio"]) {
    padding: 0.7rem 0.9rem;
    border: 1px solid #D7CFC4;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-family: 'Raleway', sans-serif;
    color: var(--nude-text);
    background: var(--nude-surface);
    transition: border-color .15s, box-shadow .15s;
}
.field input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--nude-primary);
    box-shadow: 0 0 0 3px rgba(192, 135, 106, 0.15);
}
.consent {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    font-size: 0.75rem;
    color: var(--nude-muted);
    line-height: 1.45;
}
.consent input { margin-top: 0.15rem; accent-color: var(--nude-primary); }

/* ---------- Botones ---------- */
.btn {
    display: inline-block;
    background: var(--nude-primary);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.5rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--nude-primary-dark); }
.btn:active { transform: scale(0.96); transition: transform 80ms cubic-bezier(0.4,0,0.2,1); }
.btn-full { width: 100%; }

/* Estado "ya activado" (notificaciones) — el botón se convierte en insignia,
   no queda como un botón accionable de nuevo. */
.btn-active-state {
    background: rgba(168, 197, 185, 0.18);
    color: #4E7A65;
    border: 1px solid rgba(168, 197, 185, 0.4);
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}
.btn-active-state:hover { background: rgba(168, 197, 185, 0.18); }
.btn-active-state:active { transform: none; }
@media (prefers-color-scheme: dark) {
    .btn-active-state { background: rgba(168, 197, 185, 0.14); color: #A8C5B9; }
}

/* Botón secundario translúcido (compartir, instalar) */
.btn-ghost {
    background: rgba(var(--nude-surface-rgb), 0.6);
    color: var(--nude-text);
    border: 1px solid rgba(var(--nude-border-rgb), 0.9);
}
.btn-ghost:hover { background: rgba(var(--nude-surface-rgb), 0.85); }

.btn-row { display: flex; gap: 0.6rem; }
.btn-row .btn { flex: 1; font-size: 0.88rem; padding-left: 1rem; padding-right: 1rem; }
@media (max-width: 380px) {
    .btn-row { flex-direction: column; }
}

/* Feedback táctil global en toda superficie interactiva */
.premium-card, .card { transition: transform 120ms cubic-bezier(0.4,0,0.2,1); }
@media (hover: none) {
    .premium-card:active { transform: scale(0.985); }
}

/* ---------- Éxito ---------- */
.check-badge-wrap {
    position: relative;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
}
#confetti-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}
.check-badge {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 999px;
    background: rgba(168, 197, 185, 0.2);
    color: #6F9A87;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: check-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: 100ms;
}
@keyframes check-pop {
    0%   { opacity: 0; transform: scale(0.4); }
    100% { opacity: 1; transform: scale(1); }
}

/* Texto "¡Bienvenida!" tecleado letra por letra */
.typed-headline .char { opacity: 0; }
.typed-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 2px;
    vertical-align: -0.15em;
    background: currentColor;
    animation: cursor-blink 900ms step-end infinite;
}
@keyframes cursor-blink {
    0%, 49%  { opacity: 1; }
    50%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .check-badge { animation: none !important; opacity: 1 !important; transform: none !important; }
    .typed-headline .char { opacity: 1 !important; }
    .typed-cursor { display: none !important; }
}
.member-code {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    color: var(--nude-text);
    background: var(--nude-bg);
    border: 1px dashed var(--nude-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin: 1rem 0;
    text-align: center;
}

/* ---------- QR (éxito) ---------- */
.qr-box {
    display: inline-flex;
    padding: 0.75rem;
    background: #fff;
    border: 1px solid var(--nude-border);
    border-radius: 1rem;
    margin: 0.5rem 0 0.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.qr-box img, .qr-box canvas { display: block; }

/* ---------- Stack (tarjeta) ---------- */
.stack { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.stack > * { min-width: 0; }

/* ---------- Tarjeta Premium ---------- */
.premium-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    border-radius: 1.5rem;
    padding: 1.5rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(192, 135, 106, 0.25);
    background: linear-gradient(135deg, var(--nude-card-dark), var(--nude-card-mid) 55%, var(--nude-card-light));
}
.premium-card::before,
.premium-card::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(30px);
}
.premium-card::before { width: 10rem; height: 10rem; top: -3rem; right: -3rem; background: rgba(255,255,255,0.08); }
.premium-card::after { width: 12rem; height: 12rem; bottom: -5rem; left: -3rem; background: rgba(168,197,185,0.15); }

.premium-top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.6rem;
    min-width: 0;
}
.premium-brand {
    display: flex; align-items: center; gap: 0.5rem; font-size: 0.65rem;
    text-transform: uppercase; letter-spacing: 0.18em; color: rgba(255,255,255,0.75);
    min-width: 0; flex-shrink: 1;
}
.premium-brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.premium-tag { flex-shrink: 0; }
.premium-dot { width: 0.6rem; height: 0.6rem; border-radius: 999px; background: var(--nude-accent); }
.premium-tag { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--nude-accent); font-weight: 700; }

.premium-user {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    min-width: 0;
}
.premium-user-info { display: flex; align-items: center; gap: 0.8rem; min-width: 0; flex: 1; }

/* Logo de marca integrado en la propia tarjeta (como el isotipo de una
   tarjeta de crédito) — antes vivía en un panel oscuro aparte, con mucho
   espacio vacío alrededor. Ahora es parte del mismo material de la
   tarjeta, con una pequeña entrada animada al cargar. */
.premium-logo {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 5.5rem;
    height: 4.4rem;
    border-radius: 1rem;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.22);
    animation: premium-logo-materialize 700ms cubic-bezier(0.2, 0.8, 0.2, 1) 150ms both;
}
.premium-logo img { width: 100%; height: 100%; object-fit: contain; }
@keyframes premium-logo-materialize {
    0%   { opacity: 0; filter: blur(10px); transform: scale(0.7) rotate(-4deg); }
    60%  { opacity: 1; filter: blur(0); }
    100% { opacity: 1; filter: blur(0); transform: scale(1) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
    .premium-logo { animation: logo-fade-only 260ms ease both; }
}

.avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.premium-user > div { min-width: 0; }
.premium-name {
    font-size: 1.05rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.premium-id { font-size: 0.7rem; font-family: monospace; letter-spacing: 0.06em; color: rgba(255,255,255,0.55); }

.premium-points {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}
.premium-points > div:first-child { min-width: 0; flex-shrink: 0; }
.premium-label { display: block; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.14em; color: rgba(255,255,255,0.55); margin-bottom: 0.3rem; }
.premium-count { display: flex; align-items: baseline; gap: 0.3rem; }
.premium-count strong { font-size: 2.6rem; font-weight: 700; line-height: 1; }
.premium-count span { color: rgba(255,255,255,0.6); font-size: 1rem; }
@media (max-width: 360px) {
    .premium-count strong { font-size: 2.1rem; }
}

/* ---------- Camino de premios (hasta 5 hitos de puntos) ---------- */
.rewards-path {
    position: relative;
    z-index: 1;
    margin-top: 0.3rem;
}
.rewards-line {
    position: absolute;
    top: 1.05rem;
    left: 1.05rem;
    right: 1.05rem;
    height: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    overflow: hidden;
}
.rewards-line-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--nude-accent), #D9C5B2);
    transition: width .7s cubic-bezier(0.16,1,0.3,1);
}
.rewards-nodes {
    position: relative;
    display: flex;
    justify-content: space-between;
}
.reward-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}
.reward-node-icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    /* Sólido y opaco a propósito (no rgba translúcido + opacity): el círculo
       tiene que TAPAR por completo el tramo de .rewards-line que pasa detrás
       de él — con transparencia, la línea se veía cruzando el ícono. El
       look "bloqueado" se logra con el filtro grayscale sobre el emoji, no
       con transparencia del fondo. */
    background: var(--nude-card-mid);
    border: 2px solid rgba(255,255,255,0.22);
    filter: grayscale(0.7);
    transition: transform .2s ease;
}
.reward-node-pts { font-size: 0.6rem; font-weight: 700; color: rgba(255,255,255,0.55); }
.reward-node.is-available .reward-node-icon {
    filter: none;
    background: #fff;
    border-color: #fff;
    animation: reward-pulse 1.8s ease-in-out infinite;
}
.reward-node.is-available .reward-node-pts { color: #fff; font-weight: 800; }
.reward-node.is-redeemed .reward-node-icon {
    filter: none;
    background: #A8C5B9;
    border-color: #A8C5B9;
}
.reward-node.is-redeemed .reward-node-pts { color: rgba(255,255,255,0.8); }
@keyframes reward-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
    .reward-node.is-available .reward-node-icon { animation: none; }
}

/* Botón "Ver mi regalo" — pulso suave para invitar al toque */
.reward-cta { animation: reward-cta-pulse 2.2s ease-in-out infinite; }
@keyframes reward-cta-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(192,135,106,0.45); }
    50% { box-shadow: 0 0 0 9px rgba(192,135,106,0); }
}
@media (prefers-reduced-motion: reduce) { .reward-cta { animation: none; } }

.reward-reveal { text-align: center; }
.reward-reveal-item { margin-bottom: 0.85rem; }
.reward-reveal-item:last-of-type { margin-bottom: 0; }
.reward-reveal-icon {
    font-size: 2.4rem;
    margin-bottom: 0.4rem;
    animation: reward-reveal-pop 550ms cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes reward-reveal-pop {
    0% { opacity: 0; transform: scale(0.4) rotate(-8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) { .reward-reveal-icon { animation: none; } }
.reward-reveal-text { font-size: 0.95rem; }

/* ---------- Bottom sheet real (apple-motion.js: initBottomSheet) ----------
   .sheet nace anclado abajo, transform-origin lo fija JS al abrir según el
   botón que lo disparó. El handle es la zona arrastrable (resistencia de
   goma + cierre por velocidad, ver apple-motion.js). */
.sheet-backdrop {
    position: fixed; inset: 0;
    background: rgba(30,26,22,0.4);
    z-index: 998;
    opacity: 0;
}
.reward-reveal.sheet {
    position: fixed; left: 0; right: 0; bottom: 0;
    width: 100%; max-width: 28rem; margin: 0 auto;
    z-index: 999;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: 82vh;
    overflow-y: auto;
    padding-top: 0.4rem;
    box-shadow: 0 -8px 32px rgba(74,70,64,0.22);
}
.sheet-handle {
    display: flex; justify-content: center;
    padding: 0.5rem 0 0.85rem;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none; user-select: none;
}
.sheet-handle:active { cursor: grabbing; }
.sheet-handle-bar {
    width: 2.5rem; height: 0.3rem; border-radius: 999px;
    background: var(--nude-border);
}

/* Badge de nivel (Bronce/Plata/Oro) dentro del tag de la tarjeta premium */
.premium-tag.nivel-bronce { color: #E3A467; }
.premium-tag.nivel-plata { color: #D9D9D9; }
.premium-tag.nivel-oro { color: #FFD36B; }

/* Variante compacta de la tarjeta premium — mismo diseño, menos padding y
   tipografía más chica, para que ocupe menos alto en pantalla. */
.premium-card-compact { padding: 1.15rem; }
.premium-card-compact .premium-top { margin-bottom: 1.1rem; }
.premium-card-compact .premium-user { margin-bottom: 1.1rem; }
.premium-card-compact .avatar { width: 2.5rem; height: 2.5rem; font-size: 1rem; }
.premium-card-compact .premium-name { font-size: 0.95rem; }
.premium-card-compact .premium-logo { width: 4.5rem; height: 3.6rem; }
.premium-card-compact .premium-points { margin-bottom: 0.9rem; }
.premium-card-compact .premium-count strong { font-size: 2.1rem; }

/* ---------- Footer ---------- */
.foot {
    margin-top: auto;
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.7rem;
    color: var(--nude-muted);
}

/* ---------- Banner de instalación PWA ---------- */
.install-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    padding: 0.9rem 1rem;
    background: rgba(var(--nude-surface-rgb), 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(var(--nude-border-rgb), 0.9);
    border-radius: 1.1rem;
    animation: card-rise 500ms cubic-bezier(0.16,1,0.3,1) both;
}
.install-banner img { width: 2.5rem; height: 2.5rem; border-radius: 0.6rem; flex-shrink: 0; }
.install-banner-text { flex: 1 1 8rem; min-width: 0; }
.install-banner-text strong { display: block; font-size: 0.85rem; color: var(--nude-text); }
.install-banner-text span { font-size: 0.72rem; color: var(--nude-muted); }
.install-banner-action-row { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.install-banner-close {
    background: none;
    border: none;
    color: var(--nude-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.3rem;
    flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
    .install-banner { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .app-wrap { padding: 1rem 0.85rem 2rem; }
    .card { padding: 1.25rem; }
}

/* Trampa anti-bot: campo señuelo fuera de pantalla (no display:none, para
   que bots simples que solo revisan visibilidad "básica" igual lo llenen) */
.bt-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Aviso de referido en registro.php */
.ref-banner {
    background: rgba(168, 197, 185, 0.22);
    border: 1px solid rgba(168, 197, 185, 0.55);
    color: #4A6357;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 0.6rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

/* ---------- Promo de lanzamiento (registro.php) ---------- */
.promo-banner {
    border-radius: 0.85rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.promo-banner-strip {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(192,135,106,0.14), rgba(168,197,185,0.14));
    border: 1px solid rgba(192,135,106,0.35);
    color: var(--nude-text);
    padding: 0.6rem 0.85rem;
    font-weight: 500;
}
.promo-banner-badge {
    background: var(--nude-primary);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    flex-shrink: 0;
    animation: promo-badge-pulse 2.2s ease-in-out infinite;
}
@keyframes promo-badge-pulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
.promo-banner-cupos {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--nude-primary);
    background: rgba(255,255,255,0.7);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    flex-shrink: 0;
}
.promo-banner-won {
    background: rgba(192,135,106,0.14);
    border: 1px solid rgba(192,135,106,0.4);
    color: #7A5340;
    font-weight: 600;
    text-align: center;
    padding: 0.7rem 1rem;
}

/* ============ MODAL "Reservar cita" (reservarModalHtml() en db.php) ============
   <dialog> nativo conteniendo un <iframe> que carga reservar.php completo —
   su asistente de 4 pasos vive intacto adentro, con su propio diseño
   "Editorial Noir" (deliberadamente distinto a esta hoja de estilos). El
   modal en sí es solo el marco: pantalla completa en móvil (mismo espíritu
   que el resto de loyalty/, mobile-first), con un botón "✕" flotante para
   cancelar el asistente en cualquier punto sin tener que retroceder paso a
   paso. */
.modal-reservar {
    border: none; padding: 0; margin: 0;
    width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh;
    background: #FAFAF1;
}
.modal-reservar::backdrop { background: rgba(18,18,18,0.6); }
.modal-reservar-close {
    position: fixed; top: 0.85rem; right: 0.85rem; z-index: 20;
    width: 2.25rem; height: 2.25rem; border-radius: 50%;
    background: rgba(18,18,18,0.85); color: #FAFAF1;
    border: none; font-size: 1.1rem; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.modal-reservar-iframe { width: 100%; height: 100%; border: none; display: block; }
@media (min-width: 640px) {
    .modal-reservar {
        width: min(94vw, 30rem); height: min(92dvh, 44rem);
        border-radius: 1rem; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        margin: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .promo-banner-badge { animation: none; }
}

/* ---------- Animación de entrada/salida de <dialog> (.dialog-sheet) ----------
   Ver crm/assets.css para la explicación completa (mismo mecanismo, mismo
   nombre de clase, duplicado a mano siguiendo la convención ya usada entre
   crm/ y loyalty/ en vez de compartir un archivo). */
.dialog-sheet {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .45s cubic-bezier(0.34,1.56,0.64,1), transform .45s cubic-bezier(0.34,1.56,0.64,1);
}
.dialog-sheet.is-open { opacity: 1; transform: translateY(0); }
.dialog-sheet.closing {
    opacity: 0;
    transform: translateY(24px);
    transition-timing-function: cubic-bezier(0.16,1,0.3,1);
}
@media (prefers-reduced-motion: reduce) {
    .dialog-sheet { transition: opacity .2s ease; transform: none !important; }
}

/* ============================================================
   ACCESIBILIDAD — materiales y transparencia (apple-design §14)
   Reduced-motion ya está cubierto en el resto del archivo (por
   componente); esto cubre los dos ejes que faltaban: transparencia
   reducida y contraste alto, para cualquier superficie "glass".
   ============================================================ */
@media (prefers-reduced-transparency: reduce) {
    .card, .auth-card, .premium-card, .hero-compact, .auth-visual, .auth-mobile-medallion {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: var(--nude-surface, #fff) !important;
    }
}
@media (prefers-contrast: more) {
    .card, .auth-card {
        background: var(--nude-surface, #fff);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: 2px solid var(--nude-text, #4A4640);
    }
}
