/* Variables y Configuración General */
:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --primary-color: #6e8efb;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Puedes cambiar esto por una url('../img/bg.jpg') si tienes una imagen */
    background: #1a1a2e; 
    background-image: radial-gradient(circle at 50% 50%, #1a1a2e 0%, #16213e 100%);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Formas animadas en el fondo */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 10s infinite alternate ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    background: #6e8efb;
    top: 10%;
    left: 10%;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #a777e3;
    bottom: 10%;
    right: 5%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(50px) scale(1.1); }
}

/* Efecto Glassmorphism Base */
.glass-panel, .glass-navbar, .glass-footer {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-navbar, .glass-footer {
    border-left: none;
    border-right: none;
}

.form-container {
    border-radius: 20px;
}

/* Inputs de Formulario de Cristal */
.glass-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white !important;
    transition: all 0.3s ease;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(110, 142, 251, 0.5);
}

.glass-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* Estilos de las opciones del Select para que se vean bien al abrir */
select option {
    background: #1a1a2e;
    color: white;
}

/* Botón Personalizado */
.custom-btn {
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.custom-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(167, 119, 227, 0.4);
}

/* ---- LÓGICA DE LA TARJETA 3D ---- */
.card-wrapper {
    perspective: 1000px; /* Crea la profundidad 3D */
    width: 100%;
    max-width: 400px;
    height: 240px;
    margin: 0 auto;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Clase que aplicará JS para voltear la tarjeta */
.card-wrapper.flip .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden; /* Oculta la parte de atrás cuando está girada */
    border-radius: 20px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-back {
    transform: rotateY(180deg); /* La cara trasera ya está girada 180 grados */
    padding: 0;
    justify-content: center;
}

/* Detalles internos de la tarjeta */
.chip {
    width: 50px;
    height: 40px;
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    border-radius: 8px;
    opacity: 0.8;
}

.card-number {
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: white;
    font-family: 'Courier New', Courier, monospace;
}

.magnetic-strip {
    width: 100%;
    height: 50px;
    background: rgba(0, 0, 0, 0.8);
}

.cvv-box {
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

/* Responsividad extra */
@media (max-width: 768px) {
    .card-wrapper { height: 220px; }
    .card-number { font-size: 1.2rem; }
}