/* --- Variables y Configuración Base --- */
:root {
    --bg-color: #0a0e17; /* Fondo oscuro si la imagen falla */
    --card-bg: rgba(20, 25, 40, 0.9); /* Fondo tarjetas traslúcido */
    --primary-purple: #6c5ce7; /* Morado */
    --deep-purple: #4a3cb3;
    --neon-green: #00ff88; /* Verde Neón */
    --neon-green-glow: rgba(0, 255, 136, 0.6);
    --text-main: #ffffff;
    --text-muted: #a0aab5;
    --danger: #ff4757;
    --warning: #ffa502;
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
    --border-radius: 12px;
    --transition: all 0.3s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    /* Asegúrate de tener la imagen en la carpeta correcta */
    background-image: url(/imagenes/fondo.png); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Capa de color morado/oscuro sobre la imagen */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(30, 10, 60, 0.85) 0%, rgba(10, 10, 20, 0.95) 100%);
    z-index: 0;
}

.main-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin-top: 20px;
}

/* --- Cabecera --- */
.app-header { text-align: center; margin-bottom: 25px; }
.app-header h1 { font-size: 2.2rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; }
.text-highlight { color: var(--neon-green); text-shadow: 0 0 15px var(--neon-green-glow); }

/* --- Contenedor de Pasos (Cards) --- */
.container { width: 100%; }
.step {
    display: none; /* Ocultos por defecto */
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--border-radius);
    border: 1px solid rgba(108, 92, 231, 0.3);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(8px);
}
.step.active { display: block; animation: slideIn 0.5s ease forwards; }

/* Encabezados de Paso */
.step-header { display: flex; align-items: center; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.step-number {
    background: var(--primary-purple); color: white;
    width: 35px; height: 35px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: bold; margin-right: 15px;
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.5);
}
.step h2 { font-size: 1.3rem; font-weight: 600; }
.step-description { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* --- Círculo del Número (Paso 1) --- */
.circle {
    width: 150px; height: 150px;
    border: 4px solid var(--neon-green);
    border-radius: 50%;
    margin: 25px auto;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 700;
    background: rgba(0, 0, 0, 0.3);
    color: var(--neon-green);
    box-shadow: 0 0 20px var(--neon-green-glow), inset 0 0 10px var(--neon-green-glow);
    transition: filter 0.2s, transform 0.2s;
    letter-spacing: 2px;
}
.digit-group { margin: 0 2px; }
.blur-effect { filter: blur(5px); transform: scale(0.96); }

/* --- Botones --- */
.controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }
.action-group { display: flex; gap: 10px; }

button {
    font-family: 'Poppins', sans-serif; font-weight: 600;
    cursor: pointer; border-radius: 8px; border: none;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 8px;
}

/* Botón Generar (Morado) */
.btn-primary { background: var(--primary-purple); color: white; padding: 14px; font-size: 1.05rem; width: 100%; }
.btn-primary:hover { background: var(--deep-purple); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4); }

/* Botones Agregar/Eliminar */
.btn-secondary { background: rgba(255,255,255,0.1); color: white; padding: 12px; flex: 1; font-size: 0.9rem;}
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.btn-danger { background: rgba(255, 71, 87, 0.1); color: var(--danger); padding: 12px; flex: 1; border: 1px solid rgba(255, 71, 87, 0.3); font-size: 0.9rem;}
.btn-danger:hover { background: rgba(255, 71, 87, 0.2); }

/* Botones Navegación (Verde) */
.btn-action-next, .btn-action-finish {
    background: var(--neon-green); color: #052c1a;
    width: 100%; padding: 15px; margin-top: 20px;
    font-size: 1.05rem; text-transform: uppercase; letter-spacing: 1px;
}
.btn-action-next:hover, .btn-action-finish:hover { box-shadow: 0 0 20px var(--neon-green-glow); transform: translateY(-2px); }
.btn-action-next:disabled { background: #444; color: #888; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-action-next .arrow { transition: transform 0.3s; }
.btn-action-next:hover .arrow { transform: translateX(5px); }

/* --- Lista de Números y Resumen de Pago --- */
.selected-list { margin-bottom: 20px; text-align: left; background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px;}
.selected-list h3 { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 10px; }
.numbers-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; margin-bottom: 15px;}
.no-tag {
    background: rgba(0, 255, 136, 0.1); color: var(--neon-green);
    padding: 4px 10px; border-radius: 20px;
    font-size: 0.85rem; font-weight: 600; border: 1px solid rgba(0, 255, 136, 0.3);
}
.placeholder-text { color: #555; font-size: 0.85rem; font-style: italic; }

/* Resumen de Pago */
.payment-summary { border-top: 1px dashed rgba(255,255,255,0.1); padding-top: 12px; }
.price-row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 0.85rem; color: var(--text-muted); }
.price-row.total { margin-top: 8px; font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.neon-text-purple { color: #a29bfe; text-shadow: 0 0 8px rgba(162, 155, 254, 0.5); }
.neon-text-green { color: var(--neon-green); text-shadow: 0 0 10px var(--neon-green-glow); }

/* Advertencia */
.infobox { display: flex; align-items: start; gap: 10px; padding: 12px; border-radius: 8px; text-align: left; font-size: 0.85rem; }
.infobox.warning { background: rgba(255, 165, 2, 0.1); color: var(--warning); border: 1px solid rgba(255, 165, 2, 0.3); }

/* --- Paso 2: Pago (Optimizado y Centrado) --- */
.payment-card { 
    text-align: center; 
    display: flex;
    flex-direction: column;
    align-items: center; /* Centra todo el contenido de la tarjeta */
}

.payment-amount-box {
    background: rgba(0, 255, 136, 0.1); 
    border: 1px solid var(--neon-green);
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px;
    width: 100%; /* Ocupa todo el ancho disponible de la tarjeta */
}

.payment-amount-box p { font-size: 1rem; color: var(--text-muted); margin-bottom: 5px;}
#payment-total-display { color: var(--neon-green); font-size: 1.6rem; text-shadow: 0 0 15px var(--neon-green-glow); font-weight: 700;}

.payment-method { margin-bottom: 15px; color: var(--text-muted); font-size: 0.9rem;}
.yape-logo-img { height: 35px; margin-bottom: 8px; }

/* Contenedor blanco para el QR (Estilo tarjeta física) */
.yape-box { 
    background: white; 
    padding: 15px; 
    display: flex; /* Cambiado a flex para centrar contenido */
    justify-content: center;
    align-items: center;
    border-radius: 12px; 
    margin: 0 auto 25px auto; /* Centrado horizontalmente con margen inferior */
    box-shadow: 0 5px 15px rgba(0,0,0,0.3); 
    
    /* Control de tamaño: Ajustamos el ancho del contenedor blanco */
    width: 100%;
    max-width: 200px; /* Ancho máximo ideal para el QR en celular */
}

/* Contenedor específico de la imagen (Ajustado para imagen rectangular alta) */
.qr-wrapper { 
    width: 100%; /* Ocupa todo el ancho del .yape-box (restando el padding) */
    /* Ya no definimos altura fija para que se adapte a la imagen rectangular */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
    border-radius: 8px; /* Un pequeño borde redondeado a la imagen misma */
}

/* La imagen del QR (Crucial para que no se deforme) */
.qr-image { 
    width: 100%; /* Se ajusta al ancho del wrapper */
    height: auto; /* MANTIENE LA PROPORCIÓN RECTANGULAR ORIGINAL */
    display: block; /* Elimina espacios extra inferiores */
}

.btn-telegram { background: #0088cc; color: white; width: 100%; padding: 14px; border-radius: 8px; font-size: 0.95rem; }
.btn-telegram:hover { background: #0077b5; transform: translateY(-2px); }

.btn-telegram { background: #0088cc; color: white; width: 100%; padding: 14px; border-radius: 8px; font-size: 0.95rem; }
.btn-telegram:hover { background: #0077b5; transform: translateY(-2px); }

/* --- Paso 3: Formulario --- */
.pro-form { display: flex; flex-direction: column; gap: 15px; text-align: left; }
.form-row { display: flex; gap: 12px; }
.input-group { display: flex; flex-direction: column; gap: 5px; flex: 1;}
.flex-2 { flex: 2; } .flex-3 { flex: 3; }
.input-group label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase;}

.pro-form input, .pro-form select {
    padding: 12px; background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 8px;
    color: white; font-family: 'Poppins', sans-serif; font-size: 0.95rem;
    transition: var(--transition); width: 100%;
}
.pro-form input:focus, .pro-form select:focus { outline: none; border-color: var(--primary-purple); box-shadow: 0 0 10px rgba(108, 92, 231, 0.3); }

/* Tarjeta de Confianza */
.trust-card {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.1) 0%, rgba(0, 255, 136, 0.1) 100%);
    padding: 15px; border-radius: var(--border-radius); margin-top: 10px;
    border: 1px solid rgba(255,255,255,0.05);
}
.trust-icon { font-size: 1.8rem; }
.trust-msg { font-size: 0.9rem; color: #b0fbff; font-style: italic; line-height: 1.4; font-weight: 500; }

/* --- BOLETA ESTILO TICKET --- */
.ticket-card {
    background: #fff;
    color: #333;
    padding: 25px;
    border-radius: 10px;
    border: 2px dashed #6c5ce7;
    max-width: 320px;
    margin: 0 auto;
    font-family: 'Courier New', monospace;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
}
.ticket-header { text-align: center; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.ticket-brand { font-weight: bold; color: #6c5ce7; font-size: 1.2rem; }
.ticket-body { padding: 15px 0; font-size: 0.9rem; }
.ticket-row { display: flex; justify-content: space-between; margin-bottom: 5px; }
.ticket-numbers { margin-top: 15px; border-top: 1px solid #eee; padding-top: 10px; }
.t-numbers-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.t-numbers-grid span { background: #6c5ce7; color: #fff; padding: 2px 6px; border-radius: 3px; font-weight: bold; }
.ticket-total { border-top: 2px solid #333; margin-top: 10px; padding-top: 10px; display: flex; justify-content: space-between; font-size: 1.1rem; font-weight: bold; }
.ticket-footer { text-align: center; margin-top: 15px; font-size: 0.7rem; color: #888; }

/* Contenedor Yape */
.yape-container { display: flex; flex-direction: column; align-items: center; margin-top: 15px; }
.yape-box { background: #fff; padding: 10px; border-radius: 10px; width: 220px; height: 220px; }
.qr-image { width: 100%; height: 100%; object-fit: contain; }
.yape-data { margin-top: 10px; text-align: center; }
.yape-name { font-weight: bold; color: #fff; }
.yape-phone { color: var(--neon-green); font-size: 1.2rem; font-weight: bold; }

/* --- Animaciones y Media Queries --- */
@keyframes slideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 480px) {
    .form-row { flex-direction: column; gap: 15px; }
    .action-group { flex-direction: column; gap: 8px;}
    .app-header h1 { font-size: 1.8rem; }
    .circle { width: 130px; height: 130px; font-size: 1.8rem;}
    .step { padding: 20px; }
}