/* ==========================================================================
   ECOLE SCHOOLS LOGIN PAGE — NEO-GLASS ANIMATED DESIGN v4.9.0
   ========================================================================== */

:root {
    --login-bg: #050810;
    --login-panel-bg: #0a0f1e;
    --login-card-bg: rgba(15, 23, 42, 0.7);
    --login-accent: #22d3ee;
    --login-accent-alt: #a78bfa;
    --login-accent-pink: #ec4899;
    --login-text: #f1f5f9;
    --login-muted: #94a3b8;
    --login-border: rgba(255, 255, 255, 0.08);
    --login-danger: #f87171;
    --login-success: #34d399;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--login-bg);
    color: var(--login-text);
    font-family: var(--font-main);
    min-height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.login-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* LEFT PANEL — Brand / Animation */
.login-brand-panel {
    flex: 1;
    background: var(--login-panel-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid var(--login-border);
}

/* RIGHT PANEL — Form */
.login-form-panel {
    width: 480px;
    min-width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--login-bg);
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   BRAND PANEL — BACKGROUND EFFECTS
   ========================================================================== */

.brand-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.15;
    animation: orbFloat 12s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: var(--login-accent);
    top: 10%;
    left: 20%;
    animation-delay: 0s;
}

.orb-2 {
    width: 200px;
    height: 200px;
    background: var(--login-accent-alt);
    bottom: 20%;
    right: 10%;
    animation-delay: -4s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--login-accent-pink);
    top: 60%;
    left: 10%;
    animation-delay: -8s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -20px) scale(1.1); }
    50% { transform: translate(-20px, 30px) scale(0.9); }
    75% { transform: translate(10px, 10px) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridPulse 8s ease-in-out infinite;
}

@keyframes gridPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* ==========================================================================
   MASCOT — Animated Character
   ========================================================================== */

.brand-mascot-area {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* Glowing Rings */
.glow-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
    animation: ringPulse 4s ease-in-out infinite;
}

.ring-1 {
    width: 180px;
    height: 180px;
    border-color: rgba(34, 211, 238, 0.2);
    animation-delay: 0s;
}

.ring-2 {
    width: 220px;
    height: 220px;
    border-color: rgba(167, 139, 250, 0.15);
    animation-delay: -1.3s;
}

.ring-3 {
    width: 260px;
    height: 260px;
    border-color: rgba(236, 72, 153, 0.1);
    animation-delay: -2.6s;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.5; }
}

/* Mascot Body */
.mascot-body {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-radius: 28px;
    border: 2px solid rgba(34, 211, 238, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow:
        0 0 30px rgba(34, 211, 238, 0.15),
        inset 0 0 20px rgba(34, 211, 238, 0.05);
    animation: mascotBob 3s ease-in-out infinite;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.mascot-body.excited {
    border-color: rgba(34, 211, 238, 0.6);
    box-shadow:
        0 0 40px rgba(34, 211, 238, 0.25),
        inset 0 0 20px rgba(34, 211, 238, 0.1);
}

@keyframes mascotBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Mascot Face */
.mascot-face {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Eyes */
.mascot-eye {
    width: 18px;
    height: 18px;
    background: var(--login-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: all 0.4s ease;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.4);
}

.left-eye {
    top: 35px;
    left: 32px;
}

.right-eye {
    top: 35px;
    right: 32px;
}

.eye-pupil {
    width: 8px;
    height: 8px;
    background: #0f172a;
    border-radius: 50%;
    transition: transform 0.1s ease;
}

/* Eyes covered (password input) */
.mascot-eye.covered {
    width: 20px;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
}

.mascot-eye.covered .eye-pupil {
    display: none;
}

/* Mouth */
.mascot-mouth {
    width: 16px;
    height: 8px;
    border-bottom: 3px solid var(--login-accent);
    border-radius: 0 0 10px 10px;
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.mascot-mouth.happy {
    width: 24px;
    height: 12px;
    border-bottom-width: 3px;
}

.mascot-mouth.nervous {
    width: 12px;
    height: 4px;
    border-radius: 0;
    border-bottom: 2px solid var(--login-accent);
}

/* Graduation Cap */
.mascot-cap {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
}

.cap-top {
    width: 50px;
    height: 10px;
    background: linear-gradient(135deg, var(--login-accent), var(--login-accent-alt));
    transform: perspective(30px) rotateX(15deg);
    border-radius: 2px;
}

.cap-tassel {
    position: absolute;
    top: 4px;
    right: -8px;
    width: 2px;
    height: 18px;
    background: var(--login-accent);
    border-radius: 1px;
    transform-origin: top center;
    animation: tasselSwing 2s ease-in-out infinite;
}

.cap-tassel::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -3px;
    width: 8px;
    height: 8px;
    background: var(--login-accent);
    border-radius: 50%;
}

@keyframes tasselSwing {
    0%, 100% { transform: rotate(-15deg); }
    50% { transform: rotate(15deg); }
}

/* ==========================================================================
   PARTICLES
   ========================================================================== */

.particles-container {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
}

.particle {
    position: absolute;
    background: var(--login-accent);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(20px) scale(0); }
    20% { opacity: 0.6; transform: translateY(0) scale(1); }
    80% { opacity: 0.3; transform: translateY(-30px) scale(0.8); }
    100% { opacity: 0; transform: translateY(-50px) scale(0); }
}

/* ==========================================================================
   BRAND TEXT
   ========================================================================== */

.brand-text-area {
    text-align: center;
    margin-top: 40px;
    z-index: 5;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--login-accent), var(--login-accent-alt));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--login-muted);
    margin-top: 4px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.brand-version {
    position: absolute;
    bottom: 24px;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.4);
    z-index: 5;
}

/* ==========================================================================
   LOGIN FORM
   ========================================================================== */

.form-wrapper {
    width: 100%;
    max-width: 360px;
    animation: formSlideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes formSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Avatar */
.form-avatar {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.1), rgba(167, 139, 250, 0.1));
    border: 1px solid var(--login-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.form-avatar svg {
    width: 24px;
    height: 24px;
    color: var(--login-accent);
}

/* Headings */
.form-heading {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.form-subheading {
    font-size: 13px;
    color: var(--login-muted);
    text-align: center;
    margin-bottom: 32px;
}

/* Error */
.login-error {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--login-danger);
    animation: errorPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes errorPop {
    from { opacity: 0; transform: translateY(-10px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Lockout */
.login-lockout {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(248, 113, 113, 0.06);
    border: 1px solid rgba(248, 113, 113, 0.15);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    color: var(--login-danger);
}

.login-lockout strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.login-lockout p {
    font-size: 12px;
    color: var(--login-muted);
    line-height: 1.5;
}

/* Attempts warning */
.attempts-warning {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #fbbf24;
    margin-bottom: 16px;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--login-text);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--login-muted);
    pointer-events: none;
    transition: color 0.2s ease;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--login-border);
    border-radius: 12px;
    color: var(--login-text);
    font-size: 14px;
    font-family: var(--font-main);
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    border-color: rgba(34, 211, 238, 0.4);
    background: rgba(15, 23, 42, 0.8);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper input:focus ~ .input-icon {
    color: var(--login-accent);
}

.input-wrapper input::placeholder {
    color: rgba(148, 163, 184, 0.4);
}

.input-wrapper input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Password toggle */
.toggle-password {
    position: absolute;
    right: 12px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--login-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.toggle-password:hover {
    color: var(--login-text);
    background: rgba(255, 255, 255, 0.05);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

/* Login Button */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--login-accent), #06b6d4);
    border: none;
    border-radius: 12px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    box-shadow: 0 0 30px rgba(34, 211, 238, 0.3);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.login-btn:disabled::before {
    display: none;
}

/* Spinner */
.btn-spinner {
    display: flex;
}

.btn-spinner.hidden {
    display: none;
}

.spinner-circle {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Security Badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    font-size: 11px;
    color: rgba(148, 163, 184, 0.4);
}

.security-badge svg {
    color: rgba(34, 211, 238, 0.3);
}

/* Shake Animation */
.shake {
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
    .login-container {
        flex-direction: column;
    }

    .login-brand-panel {
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--login-border);
    }

    .login-form-panel {
        width: 100%;
        min-width: unset;
        padding: 32px 24px;
    }

    .brand-mascot-area {
        width: 140px;
        height: 140px;
    }

    .mascot-body {
        width: 90px;
        height: 90px;
    }

    .glow-ring.ring-1 { width: 130px; height: 130px; }
    .glow-ring.ring-2 { width: 160px; height: 160px; }
    .glow-ring.ring-3 { width: 190px; height: 190px; }

    .brand-title { font-size: 28px; }
    .brand-text-area { margin-top: 24px; }

    .left-eye { top: 25px; left: 22px; }
    .right-eye { top: 25px; right: 22px; }
    .mascot-eye { width: 14px; height: 14px; }
    .eye-pupil { width: 6px; height: 6px; }
    .mascot-mouth { bottom: 22px; }
    .cap-top { width: 40px; height: 8px; }
    .mascot-cap { top: -14px; }
}

@media (max-width: 480px) {
    .login-brand-panel {
        min-height: 220px;
    }

    .form-wrapper {
        max-width: 100%;
    }

    .form-heading {
        font-size: 24px;
    }

    .login-form-panel {
        padding: 24px 20px;
    }
}
