:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --success-hover: #059669;
    --text-light: #ffffff;
    --text-muted: #f1f5f9; /* Un tono un poco más claro para contrastar con fondos vivos */
    --glass-bg: rgba(9, 80, 138, 0.596); /* Ligeramente más opaco para proteger el texto */
    --glass-border: rgba(255, 255, 255, 0.25); /* Borde más definido tipo cristal */
    --glass-shadow: rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    /* Ruta de tu imagen */
    background-image: url('../img/Interfaz_imagen.jpg'); 
    
    /* El truco de "Rellenar" estilo Windows */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Control del tamaño de la pantalla */
    width: 100%;
    min-height: 100vh; /* Para PC */
    min-height: 100dvh; /* ¡El salvavidas para móviles! */
    
    /* Evita que el fondo se mueva, pero ojo en móviles */
    background-attachment: fixed; 
    
    /* Centrado del contenido (hijos del body) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0; /* Elimina márgenes por defecto del navegador */
    box-sizing: border-box;
}

/* Contenedor Estilo Vidrio Esmerilado (Glassmorphism) */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px); /* Un poco más de desenfoque para aislar los colores vivos del fondo */
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 8px 32px 0 var(--glass-shadow);
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Encabezados */
.brand-header {
    text-align: center;
    margin-bottom: 30px;
}

.brand-header h1 {
    color: var(--text-light);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Sombra ligera para asegurar lectura */
}

.brand-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 400;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Formularios Transparentes */
.form-group {
    margin-bottom: 20px;
    position: relative;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15); /* Más sólido para que resalte del fondo vivo */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 0 15px;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.input-group i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    width: 25px;
}

.form-control {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 14px 10px;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Mostrar / Ocultar Contraseña (Ojo) */
.toggle-password {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s;
}
.toggle-password:hover {
    color: var(--text-light);
}

/* Checkbox Recordarme */
.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 25px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.remember-me input {
    accent-color: var(--primary-color);
    cursor: pointer;
}

/* Botones Modernos */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 10px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-color);
    color: #fff;
    margin-top: 15px;
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

/* Enlaces Inferiores */
.links-container {
    text-align: center;
    margin-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 20px;
}

.link-item {
    color: var(--text-light);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: inline-block;
    margin-bottom: 5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.link-item:hover {
    color: var(--text-light);
    text-decoration: underline;
}

/* SPINNER DE CARGA CSS */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estados de Carga */
.btn.loading .btn-text {
    visibility: hidden;
    opacity: 0;
}

.btn.loading .spinner {
    display: block;
    position: absolute;
}

/* ==========================================================================
   Solución Definitiva para el Select de Género (Glassmorphism en PC)
   ========================================================================== */
.input-group-select-custom {
    position: relative !important;
    width: 100% !important;
    display: block !important; /* Rompe el flex de Bootstrap que lo encoge */
}

.input-group-select-custom select.form-control {
    background-color: rgba(255, 255, 255, 0.07) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #e2e8f0 !important;
    border-radius: 10px !important;
    padding-left: 45px !important; /* Espacio para el icono */
    padding-right: 35px !important; /* Espacio para la flecha */
    height: 50px !important; /* Forzamos la misma altura que tus inputs principales */
    width: 100% !important;
    display: block !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e2e8f0' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 1rem center !important;
    background-size: 12px 10px !important;
}

/* Estado al dar clic */
.input-group-select-custom select.form-control:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1) !important;
}

/* Opciones desplegables legibles en PC */
.input-group-select-custom select.form-control option {
    background-color: #1e293b !important;
    color: #e2e8f0 !important;
    padding: 12px !important;
}

/* Fijar el icono de Venus/Marte en su lugar correcto */
.input-group-select-custom i.fa-venus-mars {
    position: absolute !important;
    left: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 10 !important;
    color: rgba(255, 255, 255, 0.6) !important;
    pointer-events: none !important;
}