/* ============================================================
   VillaPuntos · Sistema de diseño
   Villa de Reyes, San Luis Potosí
   Verde institucional + dorado premium · DM Sans + Playfair
   ============================================================ */

:root {
    --villa-green: #075C34;
    --villa-green-dark: #063D27;
    --villa-green-light: #0B7444;
    --villa-gold: #D7A12B;
    --villa-gold-dark: #B67E10;
    --villa-gold-soft: #F3E2B9;
    --villa-cream: #F8F8F4;
    --villa-white: #FFFFFF;
    --villa-text: #183025;
    --villa-muted: #6B7770;
    --villa-border: #E1E7E2;

    --peligro: #B3423A;
    --exito: #0B7444;
    --aviso: #B67E10;
    --info: #2F6B8F;

    --t-fuente: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
    --t-display: 'Playfair Display', Georgia, serif;

    --r-sm: 10px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;

    --s-1: 0 1px 2px rgba(24, 48, 37, 0.06);
    --s-2: 0 6px 18px rgba(24, 48, 37, 0.08);
    --s-3: 0 16px 40px rgba(24, 48, 37, 0.14);

    --header-h: 98px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
    font-family: var(--t-fuente);
    background: var(--villa-cream);
    color: var(--villa-text);
    font-size: 15.5px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--villa-green-light); }
::selection { background: rgba(215, 161, 43, 0.35); }

:focus-visible { outline: 3px solid var(--villa-gold); outline-offset: 2px; border-radius: 4px; }

.mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.04em; }
.positivo { color: var(--exito); }
.negativo { color: var(--peligro); }
.texto-suave { color: var(--villa-muted); font-size: 13.5px; }
.enlace { display: inline-block; margin-top: 12px; color: var(--villa-green-light); text-decoration: none; font-weight: 700; }
.enlace:hover { color: var(--villa-green); }
.vacio { color: var(--villa-muted); padding: 14px 0; }
.oculto { display: none !important; }

.contenedor { width: min(1160px, 100% - 48px); margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
}

/* ---------- Animaciones reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 0.61, 0.36, 1); transition-delay: var(--retardo, 0ms); }
.reveal.visible { opacity: 1; transform: none; }

@keyframes vpFlotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 999px; padding: 12px 24px;
    font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-primario { background: var(--villa-green); color: #fff; box-shadow: 0 8px 20px rgba(7, 92, 52, 0.25); }
.btn-primario:hover { background: var(--villa-green-light); }
.btn-acento { background: var(--villa-gold); color: #3d2c05; box-shadow: 0 8px 20px rgba(215, 161, 43, 0.3); }
.btn-acento:hover { background: var(--villa-gold-dark); color: #fff; }
.btn-exito { background: var(--exito); color: #fff; }
.btn-peligro { background: var(--peligro); color: #fff; }
.btn-aviso { background: var(--aviso); color: #fff; }
.btn-suave { background: #EDF3EE; color: var(--villa-green-dark); }
.btn-suave:hover { background: #E2EBE4; }
.btn-linea { background: transparent; color: var(--villa-green); box-shadow: inset 0 0 0 2px var(--villa-border); }
.btn-linea:hover { box-shadow: inset 0 0 0 2px var(--villa-green); }
.btn-blanco { background: #fff; color: var(--villa-green-dark); }
.btn-bloque { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }
.btn-mini { padding: 5px 11px; font-size: 12.5px; border-radius: 999px; }

/* ============================================================
   HEADER PÚBLICO STICKY
   ============================================================ */
.header-villa {
    position: sticky; top: 0; z-index: 90;
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--villa-border);
    height: var(--header-h);
    display: flex; align-items: center;
    transition: height 0.25s ease, box-shadow 0.25s ease;
}
.header-villa.scrolled { height: 74px; box-shadow: var(--s-2); }
.header-villa .contenedor { display: flex; align-items: center; gap: 26px; }
.logo-villa img { height: 44px; width: auto; transition: height 0.25s ease; }
.header-villa.scrolled .logo-villa img { height: 38px; }
.header-villa .contenedor.fila-header { display: flex; align-items: center; gap: 20px; }
.header-villa img[alt="VillaPuntos"] { height: 80px; width: auto; }
.header-villa.scrolled img[alt="VillaPuntos"] { height: 60px; }
.nav-movil { display: none; }
.nav-villa { display: flex; gap: 4px; margin-inline: auto; }
.nav-villa a {
    position: relative; color: var(--villa-muted); text-decoration: none;
    font-weight: 600; font-size: 14.5px; padding: 9px 14px; border-radius: 999px;
    transition: color 0.18s;
}
.nav-villa a::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
    background: var(--villa-gold); border-radius: 2px; transform: scaleX(0); transform-origin: left;
    transition: transform 0.22s ease;
}
.nav-villa a:hover { color: var(--villa-green-dark); }
.nav-villa a:hover::after { transform: scaleX(1); }
.acciones-header { display: flex; align-items: center; gap: 10px; }
.btn-menu { display: none; margin-left: auto; border: 0; background: transparent; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; }
.btn-menu svg { width: 26px; height: 26px; stroke: var(--villa-text); }

/* ============================================================
   HERO
   ============================================================ */
.hero-vp { padding: 64px 0 84px; overflow: hidden; position: relative; }
.hero-vp::before {
    content: ''; position: absolute; inset: -140px -10% auto auto; width: 560px; height: 560px;
    background: radial-gradient(circle, rgba(215, 161, 43, 0.14), transparent 62%);
}
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 56px; align-items: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 9px;
    background: #fff; border: 1px solid var(--villa-border); color: var(--villa-green);
    font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    padding: 8px 16px; border-radius: 999px; box-shadow: var(--s-1);
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--villa-gold); }
.h-hero {
    font-size: clamp(38px, 4.6vw, 58px); line-height: 1.08; letter-spacing: -0.02em;
    font-weight: 800; margin: 20px 0 8px; color: var(--villa-text);
}
.h-hero em { font-family: var(--t-display); font-style: italic; font-weight: 500; color: var(--villa-green); }
.hero-sub { color: var(--villa-muted); font-size: 17px; max-width: 46ch; margin: 14px 0 30px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-mini { display: flex; gap: 26px; margin-top: 34px; flex-wrap: wrap; }
.mini-dato strong { font-size: 21px; color: var(--villa-green-dark); display: block; line-height: 1.15; }
.mini-dato span { font-size: 12.5px; color: var(--villa-muted); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }

.hero-media { position: relative; }
.foto-marco {
    border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--s-3);
    border: 6px solid #fff;
}
.foto-marco img { width: 100%; height: 520px; object-fit: cover; }

.tarjeta-flotante {
    position: absolute; left: -34px; bottom: 30px; width: 280px;
    background: linear-gradient(150deg, var(--villa-green-dark), var(--villa-green));
    color: #fff; border-radius: var(--r-lg); padding: 20px 22px;
    box-shadow: 0 24px 50px rgba(6, 61, 39, 0.45);
    animation: vpFlotar 5.5s ease-in-out infinite;
}
.tf-saludo { font-size: 12.5px; font-weight: 600; opacity: 0.85; display: flex; align-items: center; gap: 7px; }
.tf-puntos { font-size: 42px; font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin-top: 4px; }
.tf-puntos small { font-size: 15px; font-weight: 600; opacity: 0.85; margin-left: 6px; }
.tf-progreso { height: 8px; background: rgba(255, 255, 255, 0.18); border-radius: 99px; margin: 14px 0 8px; overflow: hidden; }
.tf-progreso span { display: block; height: 100%; width: 82%; border-radius: 99px; background: linear-gradient(90deg, var(--villa-gold), #E9C25C); }
.tf-nivel { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }
.tf-nivel .nivel-chip-oro { color: #E9C25C; letter-spacing: 0.08em; }
.tf-falta { margin-top: 10px; font-size: 12.5px; opacity: 0.85; }

.insignia-flotante {
    position: absolute; right: -16px; top: 26px;
    background: #fff; border-radius: 16px; box-shadow: var(--s-2);
    padding: 10px 16px; display: flex; align-items: center; gap: 10px;
    animation: vpFlotar 6.5s ease-in-out infinite reverse;
}
.insignia-flotante svg { width: 26px; height: 26px; }
.insignia-flotante b { display: block; font-size: 13.5px; }
.insignia-flotante small { color: var(--villa-muted); font-size: 11.5px; }

/* ---------- Secciones base ---------- */
.seccion { padding: 88px 0; }
.seccion-alt { background: #fff; border-block: 1px solid var(--villa-border); }
.seccion-cabecera { max-width: 640px; margin-bottom: 48px; }
.seccion-cabecera.centro { margin-inline: auto; text-align: center; }
.kicker {
    color: var(--villa-gold-dark); font-weight: 800; font-size: 13px;
    letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 10px;
}
.h-seccion { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.14; font-weight: 800; letter-spacing: -0.015em; }
.h-seccion em { font-family: var(--t-display); font-style: italic; font-weight: 500; color: var(--villa-green); }
.seccion-desc { color: var(--villa-muted); margin-top: 12px; font-size: 16px; }

/* ---------- Beneficios / pasos ---------- */
.pasos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; counter-reset: paso; }
.paso {
    background: var(--villa-cream); border: 1px solid var(--villa-border);
    border-radius: var(--r-lg); padding: 28px 24px; position: relative;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s;
}
.paso:hover { transform: translateY(-5px); box-shadow: var(--s-2); border-color: #CBDCCF; }
.paso-num {
    font-family: var(--t-display); font-style: italic; font-size: 15px;
    color: var(--villa-gold-dark); font-weight: 600; letter-spacing: 0.08em;
}
.paso-icono {
    width: 56px; height: 56px; border-radius: 18px; margin: 14px 0 18px;
    background: linear-gradient(140deg, var(--villa-green), var(--villa-green-dark));
    display: grid; place-items: center; box-shadow: 0 10px 22px rgba(7, 92, 52, 0.28);
}
.paso-icono svg { width: 27px; height: 27px; stroke: #E9C25C; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.paso h3 { font-size: 19px; margin-bottom: 6px; }
.paso p { color: var(--villa-muted); font-size: 14px; }

/* ---------- Estadísticas ---------- */
.stats-banda {
    background:
        radial-gradient(700px 300px at 85% -30%, rgba(215, 161, 43, 0.18), transparent),
        linear-gradient(120deg, var(--villa-green-dark), var(--villa-green));
    color: #fff; padding: 64px 0;
}
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; text-align: center; }
.stat-valor { font-size: clamp(34px, 3.6vw, 46px); font-weight: 800; color: #E9C25C; letter-spacing: -0.02em; }
.stat-etiqueta { margin-top: 4px; font-weight: 600; opacity: 0.9; font-size: 14px; letter-spacing: 0.04em; }

/* ---------- Niveles ---------- */
.niveles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.tarjeta-nivel {
    background: #fff; border: 1.5px solid var(--villa-border); border-radius: var(--r-lg);
    padding: 30px 28px; position: relative; overflow: hidden;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.tarjeta-nivel:hover { transform: translateY(-6px); box-shadow: var(--s-2); }
.tarjeta-nivel.destacado { border-color: var(--villa-gold); box-shadow: 0 20px 46px rgba(215, 161, 43, 0.18); }
.etiqueta-popular {
    position: absolute; top: 18px; right: 18px; background: var(--villa-gold);
    color: #3d2c05; font-size: 11px; font-weight: 800; letter-spacing: 0.08em;
    padding: 5px 12px; border-radius: 999px; text-transform: uppercase;
}
.medalla { width: 74px; height: 74px; margin-bottom: 18px; }
.medalla-circulo {
    width: 100%; height: 100%; border-radius: 50%;
    display: grid; place-items: center; position: relative;
}
.medalla-circulo svg { width: 30px; height: 30px; }
.medalla-bronce .medalla-circulo { background: linear-gradient(145deg, #E3A479, #A9683F); box-shadow: inset 0 -4px 8px rgba(0,0,0,0.18), 0 8px 18px rgba(169,104,63,0.35); }
.medalla-plata .medalla-circulo { background: linear-gradient(145deg, #E8ECEA, #9FAAA4); box-shadow: inset 0 -4px 8px rgba(0,0,0,0.16), 0 8px 18px rgba(120,134,128,0.35); }
.medalla-oro .medalla-circulo { background: linear-gradient(145deg, #F0CE72, #C08F1D); box-shadow: inset 0 -4px 8px rgba(0,0,0,0.2), 0 8px 18px rgba(192,143,29,0.4); }
.nivel-nombre { font-size: 23px; font-weight: 800; letter-spacing: 0.06em; }
.tarjeta-bronce .nivel-nombre { color: #8f5731; }
.tarjeta-plata .nivel-nombre { color: #66736c; }
.tarjeta-oro .nivel-nombre { color: var(--villa-gold-dark); }
.nivel-rango { color: var(--villa-muted); font-weight: 600; font-size: 13.5px; margin: 2px 0 16px; }
.nivel-lista { list-style: none; display: grid; gap: 9px; margin-bottom: 20px; }
.nivel-lista li { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; color: var(--villa-text); }
.nivel-lista svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 2px; stroke: var(--villa-green-light); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nivel-barra { height: 8px; background: #EEF2EE; border-radius: 99px; overflow: hidden; }
.nivel-barra span { display: block; height: 100%; border-radius: 99px; width: var(--ancho, 30%); transition: width 1s ease 0.3s; }
.tarjeta-bronce .nivel-barra span { background: #C08A5D; }
.tarjeta-plata .nivel-barra span { background: #93A099; }
.tarjeta-oro .nivel-barra span { background: linear-gradient(90deg, var(--villa-gold), #E9C25C); }
.nivel-nota { margin-top: 8px; font-size: 12.5px; color: var(--villa-muted); }

/* ---------- Recompensas ---------- */
.recompensas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 24px; }
.recompensa-card {
    background: #fff; border-radius: var(--r-lg); overflow: hidden;
    border: 1px solid var(--villa-border); display: flex; flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.recompensa-card:hover { transform: translateY(-6px); box-shadow: var(--s-2); }
.rc-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.rc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.recompensa-card:hover .rc-media img { transform: scale(1.05); }
.rc-puntos {
    position: absolute; bottom: 12px; right: 12px;
    background: var(--villa-gold); color: #3d2c05; font-weight: 800; font-size: 13px;
    padding: 7px 14px; border-radius: 999px; box-shadow: 0 6px 16px rgba(61, 44, 5, 0.3);
}
.rc-cuerpo { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rc-cat { font-size: 12px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--villa-green-light); }
.rc-titulo { font-size: 19px; font-weight: 800; }
.rc-desc { color: var(--villa-muted); font-size: 14px; }
.rc-pie { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rc-comercio { font-size: 12.5px; color: var(--villa-muted); font-weight: 600; }

/* ---------- Comercios ---------- */
.comercios-fila {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr);
    gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding-bottom: 14px; scrollbar-width: thin;
}
.comercio-card {
    scroll-snap-align: start; background: #fff; border: 1px solid var(--villa-border);
    border-radius: var(--r-lg); overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.comercio-card:hover { transform: translateY(-5px); box-shadow: var(--s-2); }
.cc-media { aspect-ratio: 16 / 10; overflow: hidden; }
.cc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.comercio-card:hover .cc-media img { transform: scale(1.06); }
.cc-cuerpo { padding: 16px 18px 18px; }
.cc-nombre { font-weight: 800; font-size: 16.5px; }
.cc-cat { color: var(--villa-muted); font-size: 13px; font-weight: 600; margin: 2px 0 12px; }

.comunidad-banda {
    background: linear-gradient(115deg, var(--villa-green-dark) 55%, var(--villa-green));
    color: #fff; border-radius: var(--r-xl); overflow: hidden;
    display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: stretch;
}
.comunidad-copy { padding: 52px 54px; }
.comunidad-copy h3 { font-size: clamp(26px, 2.8vw, 36px); font-weight: 800; line-height: 1.15; }
.comunidad-copy h3 em { font-family: var(--t-display); font-style: italic; font-weight: 500; color: #E9C25C; }
.comunidad-copy p { opacity: 0.88; margin: 14px 0 24px; max-width: 46ch; }
.comunidad-media img { width: 100%; height: 100%; object-fit: cover; min-height: 320px; }

/* ---------- Footer ---------- */
.footer-vp { background: var(--villa-green-dark); color: rgba(255, 255, 255, 0.82); padding: 60px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 34px; }
.footer-vp img { height: 42px; margin-bottom: 14px; }
.footer-vp h4 { color: #fff; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px; }
.footer-vp ul { list-style: none; display: grid; gap: 9px; }
.footer-vp a { color: rgba(255, 255, 255, 0.78); text-decoration: none; font-size: 14.5px; }
.footer-vp a:hover { color: #E9C25C; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, 0.14); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: rgba(255,255,255,0.55); }

/* ============================================================
   MODAL REGISTRO
   ============================================================ */
.fondo-modal {
    position: fixed; inset: 0; z-index: 200; background: rgba(9, 32, 22, 0.55);
    backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center;
    padding: 20px;
}
.fondo-modal.abierto { display: flex; animation: aparecerSuave 0.25s ease; }
.modal-caja {
    background: #fff; border-radius: var(--r-xl); width: min(470px, 100%);
    max-height: min(92vh, 720px); overflow-y: auto;
    padding: 34px 34px 28px; position: relative;
    box-shadow: 0 40px 80px rgba(6, 30, 20, 0.4);
    animation: subirModal 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes aparecerSuave { from { opacity: 0; } to { opacity: 1; } }
@keyframes subirModal { from { opacity: 0; transform: translateY(26px) scale(0.98); } to { opacity: 1; transform: none; } }
.modal-logo { height: 40px; margin: 0 auto 18px; display: block; }
.modal-titulo { font-size: 26px; font-weight: 800; text-align: center; letter-spacing: -0.01em; }
.modal-titulo em { font-family: var(--t-display); font-style: italic; font-weight: 500; color: var(--villa-green); }
.modal-sub { text-align: center; color: var(--villa-muted); margin: 6px 0 22px; font-size: 14.5px; }
.modal-cerrar {
    position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
    border-radius: 50%; border: 0; background: var(--villa-cream); cursor: pointer;
    font-size: 20px; color: var(--villa-muted); line-height: 1;
}
.modal-cerrar:hover { background: var(--villa-border); color: var(--villa-text); }
.modal-pie { text-align: center; margin-top: 18px; font-size: 14px; color: var(--villa-muted); }
.modal-pie a { color: var(--villa-green); font-weight: 700; text-decoration: none; }
.bono-aviso {
    background: linear-gradient(120deg, rgba(215, 161, 43, 0.14), rgba(215, 161, 43, 0.05));
    border: 1px dashed var(--villa-gold); color: #7a5a0e;
    border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600;
    text-align: center; margin-bottom: 18px;
}

/* ============================================================
   LOGIN SPLIT
   ============================================================ */
.pagina-auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-media { position: relative; overflow: hidden; }
.auth-media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.auth-media::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(200deg, rgba(6, 61, 39, 0.25), rgba(6, 61, 39, 0.75));
}
.auth-media-txt { position: absolute; left: 44px; bottom: 44px; right: 44px; color: #fff; z-index: 2; }
.auth-media-txt img { position: static; height: 40px; width: auto; margin-bottom: 18px; object-fit: contain; }
.auth-media-txt h2 { font-size: clamp(26px, 2.6vw, 36px); font-weight: 800; line-height: 1.16; }
.auth-media-txt h2 em { font-family: var(--t-display); font-style: italic; font-weight: 500; color: #E9C25C; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 48px 30px; }
.auth-caja { width: min(420px, 100%); }
.auth-caja .logo-movil { height: 42px; margin-bottom: 30px; }
.auth-caja h1 { font-size: 30px; font-weight: 800; }
.auth-caja .sub { color: var(--villa-muted); margin: 6px 0 26px; }
.volver-inicio { display: inline-flex; align-items: center; gap: 6px; color: var(--villa-muted); text-decoration: none; font-size: 13.5px; font-weight: 600; margin-bottom: 26px; }
.volver-inicio:hover { color: var(--villa-green); }
.nota-demo { margin-top: 18px; font-size: 12.5px; color: var(--villa-muted); background: var(--villa-cream); border: 1px dashed var(--villa-border); border-radius: 12px; padding: 10px 14px; text-align: center; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.campo { display: block; margin-bottom: 15px; }
.campo span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; color: var(--villa-text); }
.campo em { color: var(--villa-muted); font-style: normal; font-weight: 500; }
.campo input, .campo select, .campo textarea,
.fila-formulario input, .filtros input, .filtros select, .buscador input {
    width: 100%; padding: 12px 14px;
    border: 1.5px solid var(--villa-border); border-radius: 12px;
    font: inherit; background: #FCFCFA; color: var(--villa-text);
    transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.campo input:focus, .campo select:focus, .campo textarea:focus,
.filtros input:focus, .filtros select:focus, .buscador input:focus,
.fila-formulario input:focus {
    outline: none; border-color: var(--villa-green-light); background: #fff;
    box-shadow: 0 0 0 4px rgba(11, 116, 68, 0.12);
}
.formulario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 18px; align-items: end; }
.campo-accion { display: flex; align-items: center; padding-bottom: 15px; }
.fila-formulario { display: flex; gap: 10px; flex-wrap: wrap; }
.fila-formulario input { flex: 1; min-width: 180px; }

/* ============================================================
   PANEL · CASCARONES
   ============================================================ */
.aplicacion { min-height: 100vh; }

.panel-admin { display: flex; }
.sidebar {
    width: 248px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--villa-green-dark), #07482B);
    color: rgba(255, 255, 255, 0.85);
    padding: 22px 14px; position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 2px 8px 20px; }
.marca-icono { width: 34px; height: 34px; border-radius: 10px; background: rgba(215, 161, 43, 0.16); display: grid; place-items: center; color: var(--villa-gold); font-weight: 800; font-size: 17px; }
.marca-texto { font-weight: 800; color: #fff; font-size: 17px; letter-spacing: -0.01em; }
.marca-texto b { color: #E9C25C; font-weight: 800; }
.marca-logo { justify-content: center; padding: 4px 8px 20px; }
.marca-logo img { background: #fff; border-radius: 10px; width: 140px; height: 70px; object-fit: contain; padding: 8px 10px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18); }
.sidebar-usuario { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, 0.08); border-radius: 14px; padding: 11px 12px; margin-bottom: 18px; }
.avatar { width: 37px; height: 37px; border-radius: 50%; background: var(--villa-gold); color: #3d2c05; display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.sidebar-usuario strong { display: block; font-size: 13.5px; color: #fff; }
.sidebar-usuario small { font-size: 11px; opacity: 0.7; }
.menu { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.menu a { color: rgba(255, 255, 255, 0.72); text-decoration: none; padding: 10px 13px; border-radius: 11px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; transition: background 0.15s, color 0.15s; }
.menu a svg { width: 18px; height: 18px; opacity: 0.85; }
.menu a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.menu a.activo { background: var(--villa-gold); color: #3d2c05; font-weight: 700; }
.menu a.activo svg { opacity: 1; }
.sidebar-pie { border-top: 1px solid rgba(255, 255, 255, 0.13); padding-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.sidebar-pie a { color: rgba(255, 255, 255, 0.72); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.sidebar-pie a:hover { color: #fff; background: rgba(255, 255, 255, 0.07); }
.sidebar-pie a.salir { color: #F0B9B3; }

.principal { flex: 1; padding: 26px 30px 46px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.topbar h1 { font-size: 23px; letter-spacing: -0.01em; }

.panel-app .principal-app {
    max-width: 1180px; margin-inline: auto; width: 100%;
    padding: 26px max(24px, calc((100% - 1180px) / 2)) 60px;
}
.titulo-movil { display: none; align-items: center; gap: 12px; margin-bottom: 4px; }
.titulo-movil h1 { font-size: 22px; }
.cabecera-app .logo-villa-img, .cabecera-app img[alt^="VillaPuntos"] { height: 38px; width: auto; }
.nav-inferior a svg, .app-nav svg { width: 18px; height: 18px; }
.chip-puntos {
    margin-left: auto; display: inline-flex; align-items: center; gap: 7px;
    background: linear-gradient(120deg, var(--villa-gold), #E9C25C); color: #3d2c05;
    font-weight: 800; padding: 8px 16px; border-radius: 999px; font-size: 14px;
    box-shadow: 0 6px 16px rgba(215, 161, 43, 0.35);
}
.btn-menu { display: none; }
.contenido { display: grid; gap: 20px; }

/* ---------- Panel app (cliente / comercio): cabecera superior ---------- */
.cabecera-app {
    position: sticky; top: 0; z-index: 80;
    background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--villa-border);
    padding: 0 max(24px, calc((100% - 1180px) / 2));
    height: 66px; display: flex; align-items: center; gap: 16px;
}
.cabecera-app .logo-villa img { height: 40px; }
.app-nav { display: flex; gap: 4px; margin-left: 18px; }
.app-nav a { color: var(--villa-muted); text-decoration: none; font-weight: 700; font-size: 14px; padding: 8px 14px; border-radius: 999px; }
.app-nav a:hover { color: var(--villa-green-dark); background: var(--villa-cream); }
.app-nav a.activo { color: var(--villa-green-dark); background: #E7F0E9; }
.usuario-app { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.usuario-app .nombre { text-align: right; line-height: 1.15; }
.usuario-app .nombre b { font-size: 14px; display: block; }
.usuario-app .nombre small { color: var(--villa-muted); font-size: 11.5px; }
.icono-btn { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--villa-border); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--villa-muted); text-decoration: none; transition: all 0.16s; }
.icono-btn:hover { color: var(--peligro); border-color: #F0C9C4; background: #FDF6F5; }
.icono-btn svg { width: 19px; height: 19px; }

.nav-inferior { display: none; }

/* ============================================================
   COMPONENTES DE PANEL (restaurados con nuevo estilo)
   ============================================================ */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.kpi {
    background: #fff; border: 1px solid var(--villa-border); border-radius: var(--r-lg);
    padding: 20px 22px; display: flex; flex-direction: column; gap: 3px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--s-2); }
.kpi-valor { font-size: 27px; font-weight: 800; color: var(--villa-green-dark); letter-spacing: -0.02em; }
.kpi-etiqueta { font-size: 12px; color: var(--villa-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; }

.tarjeta {
    background: #fff; border: 1px solid var(--villa-border); border-radius: var(--r-lg);
    padding: 24px; box-shadow: var(--s-1);
}
.tarjeta h3 { margin-bottom: 16px; font-size: 17px; }
.tarjeta h4 { font-size: 16px; }
.tarjeta-cabecera { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tarjeta-cabecera h3 { margin-bottom: 0; }
.tarjeta-destacada { border-left: 4px solid var(--villa-gold); }
.tarjeta-resumen { background: linear-gradient(130deg, #FDFBF3, #fff); border-color: #EFE4C2; }

.tabla-scroll { overflow-x: auto; }
.tabla { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabla th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--villa-muted); padding: 9px 10px; border-bottom: 2px solid var(--villa-border); white-space: nowrap; }
.tabla td { padding: 11px 10px; border-bottom: 1px solid #EEF2EF; vertical-align: top; }
.tabla tbody tr { transition: background 0.12s; }
.tabla tbody tr:hover { background: #F7FAF7; }
.tabla small { color: var(--villa-muted); }
.acciones { display: flex; gap: 5px; flex-wrap: wrap; }
.acciones form { display: inline; }

.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 800; text-transform: capitalize; }
.badge-compra { background: #E2F2E7; color: #0A5C36; }
.badge-canje { background: #FBF0D6; color: #8A6410; }
.badge-ajuste { background: #E3EEF5; color: #2F5B77; }
.badge-registro { background: #EDEAF7; color: #5B4BA0; }
.badge-admin { background: #EDEAF7; color: #5B4BA0; }
.badge-cliente { background: #ECEFEC; color: #4E5A53; }
.badge-comercio { background: #E3EEF5; color: #2F5B77; }
.badge-global { background: #FBF0D6; color: #8A6410; }
.badge-activo { background: #E2F2E7; color: #0A5C36; }
.badge-inactivo { background: #ECEFEC; color: #6B7770; }
.badge-cupon-activo { background: #E2F2E7; color: #0A5C36; }
.badge-cupon-usado { background: #ECEFEC; color: #6B7770; }
.badge-cupon-expirado { background: #F8E7E4; color: #9C3B33; }

.chip { padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.chip-verde { background: #E2F2E7; color: #0A5C36; }
.chip-rojo { background: #F8E7E4; color: #9C3B33; }
.chip-gris { background: #ECEFEC; color: #4E5A53; }
.chips-resumen { display: flex; gap: 8px; flex-wrap: wrap; }

.alerta { position: relative; padding: 13px 40px 13px 17px; border-radius: 13px; margin-bottom: 18px; font-weight: 600; animation: aparecerSuave 0.25s ease; border: 1px solid transparent; }
.alerta-exito { background: #E9F5ED; color: #0A5C36; border-color: #CBE7D5; }
.alerta-error { background: #FBEDEB; color: #9C3B33; border-color: #F0CFCA; }
.alerta-cerrar { position: absolute; right: 10px; top: 9px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: inherit; }

.barra-h { margin-bottom: 15px; }
.barra-info { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 10px; }
.barra-info span:last-child { color: var(--villa-muted); white-space: nowrap; }
.barra-pista { height: 9px; background: #EEF2EF; border-radius: 99px; overflow: hidden; }
.barra-relleno { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--villa-green), #2E8B5C); transition: width 0.9s ease; }
.barra-oro { background: linear-gradient(90deg, var(--villa-gold-dark), var(--villa-gold)); }

.grafico-barras { display: flex; align-items: flex-end; gap: 18px; height: 190px; padding: 10px 4px 0; }
.barra-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.barra-alta { width: 70%; max-width: 54px; background: linear-gradient(180deg, #2E8B5C, var(--villa-green-dark)); border-radius: 9px 9px 4px 4px; transition: height 0.5s ease; }
.barra-valor { font-size: 11.5px; color: var(--villa-muted); }
.barra-mes { font-size: 12px; font-weight: 800; color: var(--villa-green-dark); }

/* ---------- Tarjeta membresía ---------- */
.tarjeta-membresia {
    background:
        radial-gradient(400px 200px at 110% -40%, rgba(215, 161, 43, 0.35), transparent),
        linear-gradient(135deg, var(--villa-green-dark) 0%, var(--villa-green) 70%, var(--villa-green-light) 120%);
    border-radius: var(--r-xl); color: #fff; padding: 26px 28px;
    box-shadow: 0 22px 48px rgba(6, 61, 39, 0.4); position: relative; overflow: hidden;
}
.tarjeta-membresia::after { content: ''; position: absolute; right: -50px; bottom: -70px; width: 220px; height: 220px; border-radius: 50%; border: 26px solid rgba(255, 255, 255, 0.06); }
.membresia-cabecera { display: flex; justify-content: space-between; font-size: 12.5px; opacity: 0.9; margin-bottom: 22px; }
.membresia-nombre { font-size: 21px; font-weight: 700; }
.membresia-codigo { font-family: ui-monospace, Consolas, monospace; font-size: 26px; letter-spacing: 0.2em; margin: 8px 0 18px; color: #E9C25C; }
.membresia-pie { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; opacity: 0.95; }
.membresia-puntos { font-size: 25px; font-weight: 800; }

/* ---------- Niveles dentro de panel ---------- */
.tarjeta-nivel-actual {
    background: #fff; border: 1px solid var(--villa-border); border-radius: var(--r-lg); padding: 22px 24px;
}
.tna-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.nivel-insignia { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.1em; font-size: 13px; padding: 6px 14px; border-radius: 999px; }
.nivel-insignia.nivel-bronce { background: #F3E2D6; color: #8f5731; }
.nivel-insignia.nivel-plata { background: #EAEEec; color: #66736c; }
.nivel-insignia.nivel-oro { background: #FBF0D6; color: #8A6410; }
.tna-progreso { height: 10px; background: #EEF2EF; border-radius: 99px; overflow: hidden; }
.tna-progreso span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--villa-gold-dark), var(--villa-gold)); transition: width 1s ease 0.25s; }

/* ---------- Recompensas y cupones panel ---------- */
.grid-catalogo { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 18px; }
.tarjeta-recompensa { position: relative; display: flex; flex-direction: column; gap: 8px; }
.tarjeta-recompensa.deshabilitada { opacity: 0.7; }
.recompensa-puntos { position: absolute; top: -10px; right: 16px; background: var(--villa-gold); color: #3d2c05; font-weight: 800; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; box-shadow: 0 6px 14px rgba(215, 161, 43, 0.4); }
.recompensa-meta { font-size: 12.5px; color: var(--villa-muted); margin-bottom: auto; }
.tarjeta-recompensa .btn { margin-top: 10px; }

.cupon { background: #fff; border-radius: var(--r-lg); box-shadow: var(--s-1); border: 1px solid var(--villa-border); border-top: 5px solid var(--exito); overflow: hidden; display: flex; flex-direction: column; }
.cupon-usado { border-top-color: #9CA8A1; opacity: 0.85; }
.cupon-expirado { border-top-color: var(--peligro); }
.cupon-cabecera { display: flex; justify-content: space-between; padding: 13px 17px 0; font-size: 12px; color: var(--villa-muted); }
.cupon-estado { font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.cupon-activo .cupon-estado { color: #0A5C36; }
.cupon-cuerpo { padding: 10px 17px; }
.cupon-codigo {
    margin: 4px 17px 12px; padding: 13px; text-align: center;
    font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 800;
    background: repeating-linear-gradient(135deg, #FDFBF3, #FDFBF3 12px, #F7EFD8 12px, #F7EFD8 24px);
    border: 2px dashed var(--villa-gold); border-radius: 12px; color: var(--villa-green-dark);
}
.cupon-nota { padding: 0 17px 15px; font-size: 12.5px; color: var(--villa-muted); }
.cupon-mini { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 10px 13px; background: #FDFBF3; border: 1px dashed var(--villa-gold); border-radius: 11px; margin-bottom: 8px; font-size: 13px; }

/* ---------- Filtros, buscador, paginación ---------- */
.filtros { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.filtros select, .filtros input { width: auto; min-width: 150px; }
.buscador { display: flex; gap: 8px; }
.buscador input { min-width: 220px; }
.paginacion { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pag-enlace { padding: 6px 13px; border-radius: 999px; background: #EDF3EE; color: var(--villa-green-dark); text-decoration: none; font-weight: 700; font-size: 13px; }
.pag-enlace:hover { background: #E0EAE3; }
.pag-actual { background: var(--villa-green); color: #fff; }
.pag-puntos { padding: 6px 4px; color: var(--villa-muted); }

.lista-resumen { list-style: none; display: grid; gap: 8px; }
.lista-resumen li { background: var(--villa-cream); border: 1px solid var(--villa-border); border-radius: 10px; padding: 10px 13px; font-size: 13.5px; }
code { background: #EDF3EE; padding: 2px 7px; border-radius: 6px; font-size: 12.5px; word-break: break-all; color: var(--villa-green-dark); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .pasos { grid-template-columns: repeat(2, 1fr); }
    .niveles-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    :root { --header-h: 88px; }
    .header-villa img[alt="VillaPuntos"] { height: 56px; }
    .header-villa.scrolled img[alt="VillaPuntos"] { height: 56px; }
    .nav-villa { display: none; }
    .btn-menu { display: grid; place-items: center; }
    .acciones-header .btn-linea { display: none; }
    .acciones-header { margin-left: auto; }
    .header-villa.expandida { height: auto; padding-block: 8px; }
    .nav-movil { display: none; }
    .header-villa.expandida .nav-movil { display: flex; flex-direction: column; gap: 2px; padding: 10px 4px 14px; border-top: 1px solid var(--villa-border); margin-top: 10px; }
    .nav-movil a { padding: 11px 12px; border-radius: 10px; color: var(--villa-text); text-decoration: none; font-weight: 700; }
    .nav-movil a:hover { background: var(--villa-cream); }
    .header-villa.expandida .contenedor { flex-wrap: wrap; }

    .hero-vp { padding: 40px 0 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 40px; }
    .foto-marco img { height: 380px; }
    .tarjeta-flotante { left: 14px; bottom: -26px; width: min(300px, 84%); }
    .insignia-flotante { right: 10px; top: 14px; }
    .hero-media { padding-bottom: 30px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; }
    .comunidad-banda { grid-template-columns: 1fr; }
    .comunidad-media { order: -1; }
    .comunidad-media img { min-height: 240px; }
    .pagina-auth { grid-template-columns: 1fr; }
    .auth-media { min-height: 230px; }
    .auth-media-txt { left: 26px; bottom: 26px; right: 26px; }

    /* Paneles */
    .panel-admin .sidebar {
        position: fixed; z-index: 95; left: -270px; transition: left 0.28s ease;
        box-shadow: 10px 0 40px rgba(6, 30, 20, 0.35);
    }
    .panel-admin.menu-abierto .sidebar { left: 0; }
    .principal { padding: 18px 16px 96px; }
    .cabecera-app { padding: 0 16px; }
    .titulo-movil { display: flex; }
    .app-nav, .usuario-app .nombre { display: none; }
    .nav-inferior {
        display: flex; position: fixed; z-index: 96; left: 0; right: 0; bottom: 0;
        background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px);
        border-top: 1px solid var(--villa-border);
        padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    }
    .nav-inferior a {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
        font-size: 10.5px; font-weight: 700; color: var(--villa-muted); text-decoration: none;
        padding: 6px 2px; border-radius: 10px;
    }
    .nav-inferior a svg { width: 22px; height: 22px; stroke-width: 1.9; }
    .nav-inferior a.activo { color: var(--villa-green); }
    .grid-catalogo { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}

@media (max-width: 560px) {
    .contenedor { width: calc(100% - 34px); }
    .seccion { padding: 62px 0; }
    .pasos { grid-template-columns: 1fr; }
    .hero-ctas .btn { width: 100%; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .tf-puntos { font-size: 36px; }
    .modal-caja { padding: 28px 22px 22px; }
    .grafico-barras { gap: 8px; }
    .formulario-grid { grid-template-columns: 1fr; }
}
