:root {
    /* Paleta Institucional UE Maranata */
    --brand-blue: #0f3b8e;
    --brand-magenta: #c0007b;

    /* Variables de UI */
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-page: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 20px 40px rgba(15, 59, 142, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body.login-page {
    background: linear-gradient(135deg, rgba(15, 59, 142, 0.65), rgba(15, 59, 142, 0.85), rgba(192, 0, 123, 0.3)), url('../../assets/img/portada_maranata.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* --- DECORATIVE BACKGROUND ORBS --- */
.login-bg-shapes {
    position: absolute;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: floatingOrbs 20s infinite alternate ease-in-out;
}

.shape.s1 {
    width: 500px;
    height: 500px;
    background: var(--brand-magenta);
    top: -150px;
    left: -150px;
    animation-duration: 25s;
}

.shape.s2 {
    width: 600px;
    height: 600px;
    background: var(--brand-blue);
    bottom: -200px;
    right: -150px;
    animation-duration: 30s;
}

.shape.s3 {
    width: 400px;
    height: 400px;
    background: #0ea5e9;
    top: 40%;
    left: 70%;
    animation-duration: 22s;
}

@keyframes floatingOrbs {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
    }

    100% {
        transform: translate(80px, -80px) scale(1.1) rotate(15deg);
    }
}

/* --- CONTENEDOR LOGIN --- */
.login-wrapper {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* --- TARJETA GLASSMORPHISM --- */
.premium-glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 1);
    border-left: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 25px 50px rgba(15, 59, 142, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    border-radius: 28px;
    padding: 45px;
    width: 100%;
    max-width: 440px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUpFade 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    position: relative;
    overflow: hidden;
}

.premium-glass-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.5), transparent);
    transform: skewX(-25deg);
    animation: cardShimmer 7s infinite;
    z-index: 0;
}

@keyframes cardShimmer {
    0% {
        left: -150%;
    }

    15% {
        left: 200%;
    }

    100% {
        left: 200%;
    }
}

@keyframes slideUpFade {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo-container {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 2px rgba(255, 255, 255, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
    animation: floatLogo 6s ease-in-out infinite;
    cursor: pointer;
    transition: box-shadow 0.4s ease;
}

.logo-container:hover {
    box-shadow: 0 20px 40px rgba(15, 59, 142, 0.2), inset 0 0 0 3px var(--brand-magenta);
}

@keyframes floatLogo {
    0% {
        transform: translateY(0px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 2px rgba(255, 255, 255, 1);
    }

    50% {
        transform: translateY(-12px);
        box-shadow: 0 25px 45px rgba(0, 0, 0, 0.15), inset 0 0 0 2px rgba(255, 255, 255, 1);
    }

    100% {
        transform: translateY(0px);
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1), inset 0 0 0 2px rgba(255, 255, 255, 1);
    }
}

.school-logo {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.4s ease;
}

.logo-container:hover .school-logo {
    transform: scale(1.15) rotate(8deg);
    filter: drop-shadow(0 8px 12px rgba(192, 0, 123, 0.4));
}

.logo-container:active .school-logo {
    transform: scale(0.92) rotate(-4deg);
    transition: transform 0.2s ease;
}

.brand-title {
    font-size: 38px;
    font-weight: 900;
    color: var(--brand-blue);
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    letter-spacing: 3px;
    position: relative;
    z-index: 1;
}

.brand-subtitle {
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 35px;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* --- FORMULARIO Y CAMPOS --- */
.modern-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    z-index: 1;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-magenta);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 45px;
    border: 1px solid rgba(15, 59, 142, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 600;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-wrapper input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.input-wrapper input:focus {
    background: #ffffff;
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 4px rgba(15, 59, 142, 0.15), inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Iconos de Input */
.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    display: flex;
    transition: color 0.3s ease, transform 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-wrapper:focus-within .input-icon {
    color: var(--brand-blue);
    transform: translateY(-50%) scale(1.1);
}

/* --- OPCIONES DE FORMULARIO (Remember & Forgot) --- */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.remember-me {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    user-select: none;
    color: var(--text-dark);
    transition: color 0.3s;
}

.remember-me:hover {
    color: var(--brand-blue);
}

.remember-me input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: -2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.remember-me:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--brand-magenta);
}

.remember-me input:checked~.checkmark {
    background-color: var(--brand-magenta);
    border-color: var(--brand-magenta);
    box-shadow: 0 4px 10px rgba(192, 0, 123, 0.3);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.remember-me input:checked~.checkmark:after {
    display: block;
    animation: checkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkPop {
    0% {
        transform: scale(0) rotate(45deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(45deg);
        opacity: 1;
    }
}

.remember-me .checkmark:after {
    left: 5px;
    top: 2px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-pass {
    color: var(--brand-magenta);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
}

.forgot-pass::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--brand-blue);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.forgot-pass:hover {
    color: var(--brand-blue);
}

.forgot-pass:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* --- BOTÓN PREMIUM --- */
.btn-royal {
    position: relative;
    width: 100%;
    height: 56px;
    margin-top: 10px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-blue), var(--brand-magenta));
    color: white;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(15, 59, 142, 0.35);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-royal::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: all 0.6s ease;
}

.btn-royal:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(15, 59, 142, 0.5);
}

.btn-royal:hover::before {
    left: 100%;
}

.btn-royal:active {
    transform: scale(0.96) translateY(0);
}

.btn-text {
    position: relative;
    z-index: 1;
}

/* --- ALERTAS --- */
.alert-box {
    display: none;
    background: #fdf2f8;
    color: var(--brand-magenta);
    padding: 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    border: 1px solid #fce7f3;
    animation: fadeIn 0.4s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.school-footer {
    margin-top: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

/* --- CUSTOM PASSWORD ANIMATION --- */
.custom-pass-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.custom-pass-wrapper input[type="password"] {
    color: transparent !important;
    text-shadow: none !important;
    caret-color: transparent !important; /* Ocultar el cursor nativo que se desalinea */
}

.custom-pass-wrapper input[type="password"]::placeholder {
    color: #94a3b8 !important;
}

.custom-pass-dots {
    position: absolute;
    left: 45px;
    /* Offset for icon padding */
    display: flex;
    gap: 6px;
    z-index: 1;
    height: 100%;
    align-items: center;
    pointer-events: none;
    max-width: calc(100% - 60px);
    overflow: hidden;
}

.pass-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--text-dark), var(--brand-blue));
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    0% {
        transform: scale(0) translateY(10px);
        opacity: 0;
    }

    50% {
        transform: scale(1.3) translateY(-5px);
    }

    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

@keyframes popOut {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* --- GREETING MASCOT ANIMATION --- */
.greeting-mascot {
    position: fixed;
    bottom: -20px;
    right: 40px;
    width: 220px;
    height: 280px;
    z-index: 5;
    animation: slideInMascot 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom center;
    pointer-events: none;
}

.mascot-waving-arm {
    transform-origin: 130px 130px;
    animation: waveArm 2.5s infinite ease-in-out;
}

@keyframes slideInMascot {
    0% {
        transform: translateY(120%);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes waveArm {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(18deg);
    }

    75% {
        transform: rotate(-10deg);
    }
}

.mascot-tooltip {
    position: absolute;
    top: -45px;
    left: -60px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--brand-magenta);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--glass-border);
    opacity: 0;
    transform: translateY(15px);
    animation: tooltipFade 0.6s calc(1.5s) forwards;
    white-space: nowrap;
}

.mascot-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 40px;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 1);
    transform: rotate(45deg);
    border-bottom: 2px solid var(--glass-border);
    border-right: 2px solid var(--glass-border);
}

@keyframes tooltipFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}