/* ==========================================================================
   CONFIGURACIÓN MONOCROMÁTICA GLOBAL
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    /* Ruta relativa ajustada desde la carpeta CSS/ hacia la carpeta de imágenes */
    background: url('../IMG/fondologin.jpg') no-repeat center center fixed;
    background-size: cover;
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* Filtro elegante escala de grises para el fondo */
body::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.85) 100%);
    backdrop-filter: grayscale(100%);
    -webkit-backdrop-filter: grayscale(100%);
    z-index: 1;
}

/* ==========================================================================
   TARJETA CONTENEDORA (DARK GLASSMORPHISM)
   ========================================================================== */
.login-container {
    position: relative;
    z-index: 2;
    background: rgba(18, 18, 18, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08); 
    width: 100%;
    max-width: 460px; 
    padding: 95px 45px 50px 45px;
    border-radius: 24px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.7),
                inset 0 1px 1px rgba(255, 255, 255, 0.1);
    animation: entradaSuave 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   AVATAR / ICONO DE SEGURIDAD
   ========================================================================== */
.avatar-box {
    position: absolute;
    top: -60px; 
    left: 50%;
    transform: translateX(-50%);
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 3;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.avatar-border-glow {
    position: absolute;
    top: -1px; left: -1px; right: -1px; bottom: -1px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4), rgba(255,255,255,0));
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

.avatar-icon {
    width: 60px;
    height: 60px;
    color: #e5e5e5;
}

.login-container:hover .avatar-box {
    transform: translateX(-50%) translateY(-4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 30px 50px rgba(0, 0, 0, 0.8);
}

.login-container:hover .avatar-border-glow {
    opacity: 1;
}

/* ==========================================================================
   TEXTOS DEL ENCABEZADO
   ========================================================================== */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 8px;
}

.login-header p {
    color: #8a8a8a;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

/* ==========================================================================
   FORMULARIO E INPUTS FLOTANTES
   ========================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 26px; 
    width: 100%;
}

.input-group {
    width: 100%;
    position: relative;
}

.input-group input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px 16px 12px 16px;
    font-size: 14px;
    font-weight: 400;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666666;
    font-size: 14px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.input-bar {
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 1.5px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.input-group input:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label {
    top: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.input-group input:focus ~ .input-bar {
    width: 100%;
    left: 0;
}

/* ==========================================================================
   BOTÓN DE ACCIÓN CONTRASTE
   ========================================================================== */
.btn-submit {
    width: 100%;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 12px; 
    padding: 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-submit:hover {
    background: #e5e5e5;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(255, 255, 255, 0.15);
}

/* Enlace Volver atrás */
.back-to-login {
    text-align: center;
    margin-top: 15px;
}

.back-to-login .forgot-password {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #666666;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-login .forgot-password:hover {
    color: #ffffff;
}

.back-icon {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.back-to-login .forgot-password:hover .back-icon {
    transform: translateX(-4px);
}

/* ==========================================================================
   TARJETA FEEDBACK DE ÉXITO
   ========================================================================== */
.success-feedback-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0d0d0d;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.success-feedback-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.success-icon-box {
    width: 65px;
    height: 65px;
    color: #ffffff;
    margin-bottom: 20px;
    animation: bounceIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.success-icon-box svg {
    width: 100%;
    height: 100%;
}

.success-feedback-overlay h3 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.success-feedback-overlay p {
    color: #8a8a8a;
    font-size: 13.5px;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 300px;
}

.text-center-btn {
    display: block;
    text-decoration: none;
    text-align: center;
    width: 100%;
    max-width: 260px;
}

/* ==========================================================================
   ANIMACIONES Y RESPONSIVIDAD MÓVIL
   ========================================================================== */
@keyframes entradaSuave {
    from { opacity: 0; transform: scale(0.97) translateY(15px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    body { padding: 16px; }
    .login-container { padding: 85px 24px 40px 24px; border-radius: 16px; }
    .avatar-box { width: 105px; height: 105px; top: -50px; }
    .avatar-icon { width: 50px; height: 50px; }
    .login-header h2 { font-size: 20px; }
    .success-feedback-overlay { padding: 20px; }
}