* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --primario: #2563eb;
    --primario-oscuro: #1d4ed8;
    --exito: #16a34a;
    --exito-claro: #22c55e;
    --fondo: #f8fafc;
    --tarjeta: #ffffff;
    --texto: #0f172a;
    --texto-suave: #475569;
    --borde: #e2e8f0;
    --rojo: #dc2626;
    --amarillo: #eab308;
    --modo-oscuro-bg: #0f172a;
    --modo-oscuro-card: #1e293b;
    --modo-oscuro-texto: #f1f5f9;
    --modo-oscuro-borde: #334155;
}
body {
    font-family: 'Inter', sans-serif;
    background: var(--fondo);
    color: var(--texto);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    transition: background 0.3s ease, color 0.3s ease;
}
body.modo-oscuro {
    background: var(--modo-oscuro-bg);
    color: var(--modo-oscuro-texto);
}
body.modo-oscuro .tarjeta,
body.modo-oscuro .negocio-contenido,
body.modo-oscuro .modal-contenido,
body.modo-oscuro .onboarding {
    background: var(--modo-oscuro-card);
    border-color: var(--modo-oscuro-borde);
    color: var(--modo-oscuro-texto);
}
body.modo-oscuro .herramienta-card {
    background: var(--modo-oscuro-card);
    border-color: var(--modo-oscuro-borde);
}
body.modo-oscuro .herramienta-card:hover {
    background: #334155;
}
body.modo-oscuro .input-group input,
body.modo-oscuro .input-group select,
body.modo-oscuro .input-group textarea {
    background: var(--modo-oscuro-card);
    border-color: var(--modo-oscuro-borde);
    color: var(--modo-oscuro-texto);
}
.btn-modo-oscuro {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--texto-suave);
    transition: color 0.2s;
    padding: 0.3rem;
    border-radius: 50%;
}
.btn-modo-oscuro:hover {
    color: var(--primario);
    background: rgba(0,0,0,0.05);
}
.app-container {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    padding-bottom: 3rem;
    display: block;
    box-sizing: border-box;
}
.tarjeta {
    background: var(--tarjeta);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
    border: 1px solid var(--borde);
    margin-bottom: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.logo-icon {
    width: 2rem;
    height: 2rem;
    object-fit: contain;
}
.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--texto);
}
.input-group {
    margin-bottom: 1rem;
    position: relative;
}
.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--texto-suave);
    margin-bottom: 0.25rem;
}
.input-group input, .input-group select, .input-group textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid var(--borde);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}
.input-group input:focus, .input-group select:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--primario);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.toggle-password {
    position: absolute;
    right: 12px;
    top: 38px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--texto-suave);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.toggle-password:hover {
    color: var(--primario);
}
.btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--primario);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn:hover {
    background: var(--primario-oscuro);
    transform: translateY(-1px);
}
.btn-secundario {
    background: white;
    color: var(--primario);
    border: 1px solid var(--borde);
    margin-top: 0.5rem;
}
.btn-secundario:hover {
    background: var(--fondo);
}
.btn-google {
    background: white;
    color: #333;
    border: 1px solid #ddd;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-google i {
    color: #4285F4;
}
.btn-premio {
    background: var(--amarillo);
    color: var(--texto);
}
.btn-preset {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.btn-preset:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.oculto {
    display: none !important;
}
.separador {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--texto-suave);
    margin: 1.5rem 0;
}
.separador::before,
.separador::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--borde);
}
.separador:not(:empty)::before {
    margin-right: .5rem;
}
.separador:not(:empty)::after {
    margin-left: .5rem;
}
.card-personalizada {
    border-radius: 24px;
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}
.brillo-sutil {
    box-shadow: 0 0 15px rgba(255, 255, 200, 0.5), 0 20px 30px -10px rgba(0, 0, 0, 0.2);
}
.particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.card-header,
.puntos-container,
.sellos-grid,
.proximo-premio {
    position: relative;
    z-index: 2;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}
.card-header i {
    font-size: 2rem;
    opacity: 0.8;
}
.cliente-nombre {
    font-size: 1.25rem;
    font-weight: 600;
}
.puntos-container {
    text-align: center;
    margin: 2rem 0;
}
.puntos-numero {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
}
.puntos-label {
    font-size: 0.875rem;
    opacity: 0.8;
}
.sellos-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    margin: 2rem 0;
}
.sello {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}
.sello.activo {
    background: var(--exito-claro);
    border: 2px solid white;
    color: white;
}
.sello.activo.anim-punto {
    animation: puntoAnimation 0.4s ease-out;
}
@keyframes puntoAnimation {
    0% { transform: scale(1); background: var(--exito-claro); }
    50% { transform: scale(1.2); background: #ffdd44; color: #333; }
    100% { transform: scale(1); background: var(--exito-claro); }
}
.qr-simulado {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: 16px;
    color: var(--texto);
    margin-top: 1rem;
}
.qr-timer {
    font-size: 0.7rem;
    margin-top: 0.5rem;
    color: var(--texto-suave);
}
.tarjetas-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
    animation: fadeInUp 0.4s ease-out;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.tarjeta-item {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    border-radius: 24px;
    padding: 1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
.tarjeta-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.tarjeta-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.25);
}
.tarjeta-item:hover::before {
    left: 100%;
}
.tarjeta-icono {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.2);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    backdrop-filter: blur(4px);
    flex-shrink: 0;
    transition: transform 0.2s;
}
.tarjeta-item:hover .tarjeta-icono {
    transform: scale(1.05);
}
.tarjeta-contenido {
    flex: 1;
    min-width: 0;
}
.tarjeta-contenido h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tarjeta-puntos {
    font-size: 0.7rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.5rem;
}
.progreso-wrapper {
    background: rgba(255,255,255,0.25);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    position: relative;
}
.progreso-barra {
    height: 100%;
    background: linear-gradient(90deg, #ffd966, #ffb347);
    border-radius: 20px;
    width: 0%;
    transition: width 0.4s ease-out;
    position: relative;
    overflow: hidden;
}
.progreso-barra::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.3) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.3) 100%);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.tarjeta-badge {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.15);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    border: 2px solid rgba(255,255,255,0.3);
}
.badge-porcentaje {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}
.badge-label {
    font-size: 0.55rem;
    opacity: 0.8;
    margin-top: 2px;
}
.tarjeta-flecha {
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    transition: transform 0.2s, color 0.2s;
    flex-shrink: 0;
}
.tarjeta-item:hover .tarjeta-flecha {
    transform: translateX(4px);
    color: white;
}
.negocio-header {
    text-align: center;
    margin-bottom: 1.5rem;
}
.negocio-header .logo-negocio {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.75rem;
    display: block;
    border: 3px solid var(--primario);
    background: var(--fondo);
}
.negocio-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.negocio-header .direccion {
    font-size: 0.8rem;
    color: var(--texto-suave);
    margin-bottom: 0.5rem;
}
.negocio-menu {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--borde);
    padding-bottom: 0.5rem;
    flex-wrap: wrap;
}
.menu-tab {
    background: none;
    border: none;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--texto-suave);
    cursor: pointer;
    border-radius: 30px;
    transition: all 0.2s;
}
.menu-tab.active {
    background: var(--primario);
    color: white;
}
.negocio-contenido {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--borde);
}
.qr-container {
    text-align: center;
}
.btn-descargar-qr {
    margin-top: 1rem;
    background: var(--exito);
    width: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}
.herramientas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}
.herramienta-card {
    background: linear-gradient(135deg, var(--fondo) 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 1.2rem 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--borde);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.herramienta-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px rgba(0,0,0,0.1);
    border-color: var(--primario);
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
}
.herramienta-card i {
    font-size: 2.2rem;
    color: var(--primario);
    margin-bottom: 0.6rem;
    display: inline-block;
    transition: transform 0.2s;
}
.herramienta-card:hover i {
    transform: scale(1.1);
}
.herramienta-card h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    color: var(--texto);
}
.subherramienta {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--borde);
    animation: fadeInUp 0.3s ease;
}
.subherramienta h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primario);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cliente-card {
    background: white;
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--borde);
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}
.cliente-card:hover {
    transform: translateX(4px);
    border-color: var(--primario);
    box-shadow: 0 6px 14px rgba(37,99,235,0.1);
    background: #fafcff;
}
.cliente-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    color: var(--texto);
}
.cliente-info p {
    font-size: 0.7rem;
    color: var(--texto-suave);
    margin: 0;
}
.btn-premio-small {
    background: linear-gradient(135deg, var(--amarillo), #f59e0b);
    color: white;
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(245,158,11,0.3);
}
.btn-premio-small:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}
.log-entry {
    background: var(--fondo);
    border-radius: 12px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    border-left: 3px solid var(--primario);
}
.modal-perfil-contenido {
    text-align: center;
}
.modal-perfil-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--primario);
}
.modal-perfil-nombre {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.modal-perfil-direccion {
    color: var(--texto-suave);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}
.modal-perfil-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #25D36610;
    padding: 0.4rem 1rem;
    border-radius: 30px;
    color: #25D366;
    text-decoration: none;
    margin-bottom: 1.5rem;
}
/* Spinner mejorado */
.spinner-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    transition: opacity 0.5s ease;
}
.spinner {
    width: 80px;
    height: 80px;
    position: relative;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.spinner svg {
    width: 100%;
    height: 100%;
}
.spinner-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.spinner-logo img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}
.spinner-container p {
    margin-top: 2rem;
    color: white;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 1px;
    animation: pulseText 1.5s ease infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes pulseText {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.footer {
    position: fixed;
    bottom: 8px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.7rem;
    color: var(--texto-suave);
    background: transparent;
    pointer-events: none;
    z-index: 10;
}
.onboarding {
    text-align: center;
    background: var(--tarjeta);
    border-radius: 32px;
    padding: 2rem 1.5rem;
    margin: 1rem 0;
}
.onboarding .icon {
    font-size: 4rem;
    color: var(--primario);
    margin-bottom: 1rem;
}
.onboarding h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}
.onboarding p {
    color: var(--texto-suave);
    margin-bottom: 2rem;
}
.btn-onboarding {
    background: var(--primario);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
@keyframes fadeOutUp {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -80%) scale(1.2); }
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(5px);
}
.modal-contenido {
    background: white;
    border-radius: 24px;
    padding: 2rem;
    max-width: 350px;
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-contenido i {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.modal-contenido p {
    margin: 1rem 0 1.5rem;
    color: var(--texto-suave);
    word-break: break-word;
}
.modal-botones {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}
.opcion-personalizacion {
    background: var(--fondo);
    border: 1px solid var(--borde);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    text-align: left;
}
.opcion-personalizacion h4 {
    margin-bottom: 0.5rem;
}
.opciones-registro {
    display: flex;
    gap: 1rem;
    margin: 1.5rem 0;
}
.opcion-registro {
    flex: 1;
    text-align: center;
    padding: 1rem;
    background: var(--fondo);
    border: 1px solid var(--borde);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.opcion-registro:hover {
    border-color: var(--primario);
    background: #e6f0ff;
}
.opcion-registro i {
    font-size: 2rem;
    color: var(--primario);
    margin-bottom: 0.5rem;
}
@media (max-width: 400px) {
    .tarjeta { padding: 1rem; }
    .puntos-numero { font-size: 3rem; }
    .menu-tab { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
    .negocio-menu { gap: 0.5rem; }
}
.opciones-registro {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.opcion-registro {
    background: var(--fondo);
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.opcion-registro:hover {
    background: #eef2ff;
    border-color: var(--primario);
    transform: scale(1.01);
}
.opcion-registro i {
    font-size: 1.5rem;
    color: var(--primario);
    margin-bottom: 0.3rem;
}
.opcion-registro p {
    margin: 0;
}
.perfil-negocio {
    width: 100%;
}
.foto-perfil {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--borde);
    color: var(--texto-suave);
    flex-shrink: 0;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.foto-perfil i {
    font-size: 1.8rem;
    color: var(--texto-suave);
}
.foto-perfil img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
#planWarning {
    background: linear-gradient(135deg, #fff3cd, #ffe8b5);
    border-left: 4px solid var(--amarillo);
    border-radius: 16px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; box-shadow: 0 0 0 2px rgba(234,179,8,0.2); }
}

/* Mejorar visualización en escritorio */
@media (min-width: 768px) {
    .app-container {
        max-width: 500px;
    }
    .tarjeta {
        padding: 2rem;
    }
    .btn {
        padding: 1rem;
        font-size: 1.1rem;
    }
    .input-group input,
    .input-group select {
        padding: 1rem;
        font-size: 1.1rem;
    }
    .logo span {
        font-size: 1.8rem;
    }
    .logo-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
}