/* ============================================================
   style.css — Club Morena
   Diseño premium: Negro, Rojo y Dorado — estilo fintech/banco
   Sin iconos decorativos, tipografía limpia, elegante
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Paleta Morena: Negro + Rojo + Dorado */
    --negro:            #0A0A0A;
    --negro-suave:      #1A1A1A;
    --negro-card:       #141414;
    --rojo:             #C8102E;
    --rojo-dark:        #A00D25;
    --rojo-suave:       #1A0508;
    --dorado:           #C9A84C;
    --dorado-light:     #E4C470;
    --dorado-suave:     #2A2210;

    /* Grises sobre negro */
    --gris-100:         #F5F5F5;
    --gris-200:         #E8E8E8;
    --gris-400:         #999999;
    --gris-600:         #555555;
    --gris-800:         #222222;

    /* Semánticos */
    --color-fondo:          #0D0D0D;
    --color-blanco:         #FFFFFF;
    --color-primario:       var(--rojo);
    --color-primario-dark:  var(--rojo-dark);
    --color-acento:         var(--dorado);
    --color-exito:          #1DB954;
    --color-advertencia:    #F59E0B;
    --color-error:          #EF4444;
    --color-texto:          #F0F0F0;
    --color-texto-suave:    #888888;
    --color-borde:          #2A2A2A;
    --color-superficie:     #161616;
    --color-superficie-2:   #1E1E1E;

    --radio-tarjeta:    12px;
    --radio-boton:      8px;
    --sombra-suave:     0 2px 12px rgba(0,0,0,0.4);
    --sombra-media:     0 6px 24px rgba(0,0,0,0.6);
    --sombra-rojo:      0 4px 20px rgba(200,16,46,0.3);
    --alto-nav:         64px;
    --font:             'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0; padding: 0;
    -webkit-tap-highlight-color: transparent;
}
html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--color-fondo);
    color: var(--color-texto);
    min-height: 100vh;
    padding-bottom: calc(var(--alto-nav) + 8px);
}
body.sin-nav { padding-bottom: 0; }

/* ============================================================
   TIPOGRAFÍA
   ============================================================ */
h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem;    font-weight: 600; }
p  { line-height: 1.5; }

/* ============================================================
   LAYOUT
   ============================================================ */
.contenedor { max-width: 480px; margin: 0 auto; padding: 0 16px; }

/* ============================================================
   TARJETAS — superficies oscuras
   ============================================================ */
.tarjeta {
    background: var(--color-superficie);
    border-radius: var(--radio-tarjeta);
    padding: 20px;
    border: 1px solid var(--color-borde);
    margin-bottom: 12px;
}
.tarjeta-sin-padding {
    background: var(--color-superficie);
    border-radius: var(--radio-tarjeta);
    overflow: hidden;
    border: 1px solid var(--color-borde);
    margin-bottom: 12px;
}

/* ============================================================
   INPUTS
   ============================================================ */
.input-texto {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-boton);
    font-size: 1rem;
    font-family: var(--font);
    background: var(--color-superficie-2);
    color: var(--color-texto);
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
}
.input-texto:focus {
    outline: none;
    border-color: var(--rojo);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.15);
}
.input-texto::placeholder { color: var(--gris-600); }
select.input-texto option { background: var(--negro-suave); }

/* ============================================================
   BOTONES
   ============================================================ */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: var(--radio-boton);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    -webkit-appearance: none;
}
.btn:active  { transform: scale(0.97); opacity: 0.9; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.btn-primario {
    background: var(--rojo);
    color: white;
    box-shadow: var(--sombra-rojo);
}
.btn-primario:hover { background: var(--rojo-dark); }

.btn-dorado {
    background: linear-gradient(135deg, var(--dorado), var(--dorado-light));
    color: var(--negro);
}

.btn-exito  { background: var(--color-exito); color: white; }
.btn-rojo   { background: var(--rojo);        color: white; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-borde);
    color: var(--color-texto-suave);
}
.btn-outline:hover { border-color: var(--rojo); color: var(--rojo); }

.btn-gris {
    background: var(--color-superficie-2);
    color: var(--color-texto-suave);
    border: 1px solid var(--color-borde);
}

.btn-sm { padding: 9px 16px; font-size: 0.8rem; border-radius: 6px; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alerta {
    padding: 14px 16px;
    border-radius: var(--radio-boton);
    font-size: 0.875rem;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
    border: 1px solid;
}
.alerta-exito   { background: #0A1F0E; color: #4ADE80; border-color: #166534; }
.alerta-error   { background: #1A0508; color: #F87171; border-color: #7F1D1D; }
.alerta-info    { background: #0A1020; color: #93C5FD; border-color: #1E3A5F; }

/* ============================================================
   TARJETA SALDO — la pieza central de la app
   ============================================================ */
.tarjeta-saldo {
    background: var(--negro-card);
    border: 1px solid var(--color-borde);
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

/* Línea dorada superior */
.tarjeta-saldo::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--rojo), var(--dorado), var(--rojo));
}

/* Círculo decorativo sutil */
.tarjeta-saldo::after {
    content: '';
    position: absolute;
    bottom: -60px; right: -60px;
    width: 200px; height: 200px;
    border: 40px solid rgba(200,16,46,0.06);
    border-radius: 50%;
}

.saldo-etiqueta {
    font-size: 0.72rem;
    color: var(--gris-400);
    margin-bottom: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
}

.saldo-numero {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
    color: white;
    margin-bottom: 4px;
}

.saldo-unidad {
    font-size: 0.82rem;
    color: var(--gris-400);
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.saldo-nivel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(201,168,76,0.12);
    border: 1px solid rgba(201,168,76,0.25);
    padding: 5px 14px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--dorado);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* ============================================================
   BADGE DE NIVEL — estilo elegante
   ============================================================ */
.badge-nivel {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}
.badge-Bronce  { background: rgba(139,90,43,0.15);  color: #CD853F; border: 1px solid rgba(139,90,43,0.3); }
.badge-Plata   { background: rgba(148,148,148,0.1); color: #ABABAB; border: 1px solid rgba(148,148,148,0.25); }
.badge-Oro     { background: rgba(201,168,76,0.12); color: var(--dorado); border: 1px solid rgba(201,168,76,0.3); }
.badge-Premium { background: rgba(200,16,46,0.12);  color: #FF6B8A; border: 1px solid rgba(200,16,46,0.3); }

/* ============================================================
   NAVEGACIÓN INFERIOR — minimalista
   ============================================================ */
.nav-inferior {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--alto-nav);
    background: var(--negro-suave);
    border-top: 1px solid var(--color-borde);
    display: flex;
    align-items: stretch;
    z-index: 500;
    padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--gris-600);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font);
    position: relative;
}
.nav-item.activo { color: var(--rojo); }
.nav-item.activo::after {
    content: '';
    position: absolute;
    top: 0; left: 20%; right: 20%;
    height: 2px;
    background: var(--rojo);
    border-radius: 0 0 3px 3px;
}

/* Íconos del nav — línea delgada en vez de emojis */
.nav-icono {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================================
   MOVIMIENTOS / HISTORIAL
   ============================================================ */
.lista-movimientos { list-style: none; }
.movimiento-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-borde);
}
.movimiento-item:last-child { border-bottom: none; }

.movimiento-icono {
    width: 40px; height: 40px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 0; /* ocultar emojis */
}
/* Reemplazar emojis con líneas visuales */
.movimiento-icono.ganado {
    background: rgba(29,185,84,0.1);
    border: 1px solid rgba(29,185,84,0.2);
}
.movimiento-icono.ganado::after {
    content: '+';
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-exito);
    font-family: var(--font);
}
.movimiento-icono.usado {
    background: rgba(200,16,46,0.1);
    border: 1px solid rgba(200,16,46,0.2);
}
.movimiento-icono.usado::after {
    content: '−';
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--rojo);
    font-family: var(--font);
}

.movimiento-info { flex: 1; min-width: 0; }
.movimiento-motivo {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-texto);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.movimiento-fecha {
    font-size: 0.72rem;
    color: var(--color-texto-suave);
    margin-top: 3px;
    letter-spacing: 0.2px;
}
.movimiento-puntos { font-weight: 700; font-size: 0.95rem; flex-shrink: 0; }
.movimiento-puntos.ganado { color: var(--color-exito); }
.movimiento-puntos.usado  { color: var(--rojo); }

/* ============================================================
   PANTALLA ÉXITO
   ============================================================ */
.pantalla-exito { text-align: center; padding: 48px 24px; }
.exito-icono {
    width: 80px; height: 80px;
    background: rgba(29,185,84,0.1);
    border: 2px solid rgba(29,185,84,0.3);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 24px;
    animation: aparecer 0.5s cubic-bezier(0.175,0.885,0.32,1.275) forwards;
    font-size: 2rem;
}

/* ============================================================
   MODAL QR SCANNER
   ============================================================ */
.modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal.activo { display: flex; }
.modal-contenido {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    width: 100%;
    max-width: 360px;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}
#reader { width: 100%; border-radius: 8px; overflow: hidden; background: #000; }

/* ============================================================
   ACCIONES RÁPIDAS
   ============================================================ */
.acciones-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.accion-item {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-tarjeta);
    padding: 18px 12px;
    text-align: center;
    text-decoration: none;
    display: block;
    transition: border-color 0.15s, transform 0.15s;
}
.accion-item:active  { transform: scale(0.96); }
.accion-item:hover   { border-color: var(--rojo); }
.accion-emoji        { display: none; } /* sin emojis */
.accion-icon {
    width: 28px; height: 28px;
    margin: 0 auto 10px;
    stroke: var(--rojo);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
}
.accion-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-texto);
    letter-spacing: 0.2px;
}

/* ============================================================
   SECCIÓN TÍTULO
   ============================================================ */
.seccion-titulo {
    padding: 16px 0 8px;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--gris-600);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ============================================================
   CATÁLOGO DE PREMIOS
   ============================================================ */
.tarjeta-premio {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-tarjeta);
    padding: 18px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: border-color 0.15s;
}
.tarjeta-premio:hover { border-color: var(--rojo); }
.premio-emoji-lg  { display: none; }
.premio-icono {
    width: 44px; height: 44px;
    border-radius: 8px;
    background: rgba(200,16,46,0.1);
    border: 1px solid rgba(200,16,46,0.2);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--rojo);
    font-size: 1.2rem;
    font-weight: 800;
}
.premio-info      { flex: 1; min-width: 0; }
.premio-nombre-lg { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; color: var(--color-texto); }
.premio-desc      { font-size: 0.78rem; color: var(--color-texto-suave); margin-bottom: 8px; line-height: 1.4; }
.premio-puntos-req{ font-size: 0.82rem; font-weight: 700; color: var(--dorado); margin-bottom: 8px; letter-spacing: 0.3px; }
.premio-puntos-req.sin-pts { color: var(--gris-600); }

/* ============================================================
   ESTADOS VACÍOS
   ============================================================ */
.estado-vacio {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-texto-suave);
}
.estado-vacio .emoji { display: none; }
.estado-vacio::before {
    content: '—';
    display: block;
    font-size: 2rem;
    color: var(--color-borde);
    margin-bottom: 16px;
    letter-spacing: 8px;
}

/* ============================================================
   MODAL CÓDIGO FULLSCREEN
   ============================================================ */
.modal-codigo {
    display: none;
    position: fixed; inset: 0;
    background: var(--negro);
    z-index: 1000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}
.modal-codigo.activo { display: flex; }
.codigo-grande {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    letter-spacing: 6px;
    font-family: 'Courier New', monospace;
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    padding: 24px 32px;
    border-radius: 12px;
    margin: 24px 0;
}

/* ============================================================
   ADMIN HEADER Y NAV
   ============================================================ */
.admin-header {
    background: var(--negro);
    border-bottom: 1px solid var(--color-borde);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-header-logo {
    width: 8px; height: 30px;
    background: var(--rojo);
    border-radius: 2px;
    flex-shrink: 0;
}
.admin-header h1 { font-size: 1rem; font-weight: 700; margin: 0; color: white; letter-spacing: -0.2px; }
.admin-header p  { font-size: 0.72rem; color: var(--gris-400); margin: 0; letter-spacing: 0.3px; }

.admin-nav {
    background: var(--negro-suave);
    display: flex;
    border-bottom: 1px solid var(--color-borde);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-nav a {
    flex-shrink: 0;
    padding: 13px 18px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gris-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    transition: color 0.15s;
}
.admin-nav a:hover  { color: var(--color-texto); }
.admin-nav a.activo { color: var(--rojo); border-bottom-color: var(--rojo); }

/* ============================================================
   BOTTOM SHEET MODAL
   ============================================================ */
.modal-sheet-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 900;
    align-items: flex-end;
    justify-content: center;
}
.modal-sheet-overlay.activo { display: flex; }
.modal-sheet {
    background: var(--color-superficie);
    border: 1px solid var(--color-borde);
    border-radius: 16px 16px 0 0;
    padding: 28px 20px 40px;
    width: 100%;
    max-width: 480px;
    animation: subirSheet 0.3s ease;
}
.modal-handle {
    width: 36px; height: 3px;
    background: var(--color-borde);
    border-radius: 2px;
    margin: 0 auto 20px;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
.texto-centro { text-align: center; }
.texto-suave  { color: var(--color-texto-suave); }
.negrita      { font-weight: 700; }
.divider {
    border: none;
    border-top: 1px solid var(--color-borde);
    margin: 12px 0;
}

/* Línea dorada decorativa */
.linea-dorada {
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dorado), transparent);
    border: none;
    margin: 20px 0;
    opacity: 0.4;
}

/* ============================================================
   ANIMACIONES
   ============================================================ */
@keyframes aparecer {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}
@keyframes deslizarArriba {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
@keyframes subirSheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 520px) {
    .nav-inferior {
        max-width: 480px;
        left: 50%;
        transform: translateX(-50%);
    }
}
