/* ============================================
   LOGIN.CSS - EXACT ORIGINAL VERSION RESTORED
   ============================================ */

/* ========== BASE SETUP ========== */
.login-page {
}

* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    overflow: hidden;
    background-color: #ffffff;
    color: #162C5A;
}

/* ========== BACKGROUND WITH SAINT ELME PHOTO ========== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/assets/images/saint-elme-background.jpg') center/cover no-repeat;
    filter: blur(8px) brightness(0.7) saturate(1.2);
    z-index: -2;
}

/* ========== OVERLAY FOR CONTRAST ========== */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(64, 84, 178, 0.75) 0%, 
        rgba(22, 44, 90, 0.85) 50%, 
        rgba(103, 126, 234, 0.75) 100%);
    z-index: -1;
}

/* ========== FLOATING ANIMATION ========== */
@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(0.5deg); }
    66% { transform: translate(-20px, 20px) rotate(-0.5deg); }
}

/* ========== CONTAINER ========== */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
}

/* ========== LOGIN CARD ========== */
.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(25px);
    -webkit-backdrop-filter: saturate(180%) blur(25px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(22, 44, 90, 0.175);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: slideUp 0.6s ease-out;
}

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

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 90px rgba(22, 44, 90, 0.2);
}

/* ========== HEADER ========== */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* ========== SCHOOL LOGO WITH ROTATION ANIMATION ========== */
.school-logo {
    width: 120px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(22, 44, 90, 0.15);
    transition: transform 0.3s ease;
    animation: logoRotate 10s linear infinite;
}

@keyframes logoRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.school-logo:hover {
    transform: scale(1.05);
    animation-play-state: paused;
}

/* ========== TITLES ========== */
.login-title {
    font-size: 2rem;
    background: linear-gradient(135deg, #162C5A 0%, #4054B2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-subtitle {
    color: #7d7d7d;
    font-size: 1rem;
    margin: 0;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #7d7d7d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.form-label-custom .input-icon {
    color: #4054B2;
    font-size: 1.125rem;
}

.form-input-custom {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(206, 212, 218, 0.8);
    border-radius: 16px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    color: #162C5A;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(10px);
    height: 3.5rem;
    width: 100%;
    text-align: center;
}

.form-input-custom:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: #4054B2;
    box-shadow: 0 0 0 4px rgba(64, 84, 178, 0.1);
    outline: none;
}

.form-input-custom:focus + .form-label-custom {
    color: #4054B2;
}

.form-group:focus-within .form-label-custom {
    color: #4054B2;
}

/* ========== CHECKBOXES ========== */
.form-check {
    color: #7d7d7d;
}

.form-check-input:checked {
    background-color: #4054B2;
    border-color: #162C5A;
}

/* ========== LOGIN BUTTON ========== */
/* STYLES DÉPLACÉS vers components-buttons.css - Import required */
/* @import url('components-buttons.css'); */

/*
Anciens styles btn-login maintenant dans components-buttons.css
.btn-login {
    background: linear-gradient(135deg, #4054B2 0%, #162C5A 100%) !important;
    border: none !important;
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    color: white !important;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 16px rgba(64, 84, 178, 0.3) !important;
    position: relative;
    overflow: hidden;
}
*/

/* ========== ERROR ALERTS ========== */
.alert-error {
    background: linear-gradient(135deg, rgba(207, 10, 10, 0.1) 0%, rgba(255, 71, 87, 0.1) 100%);
    border: 1px solid rgba(207, 10, 10, 0.2);
    border-radius: 12px;
    color: #CF0A0A;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shakeError 0.5s ease-in-out;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ========== MISC ========== */
.csrf-token {
    display: none;
}

/* ========== FOOTER ========== */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(222, 226, 230, 0.5);
}

.login-footer p {
    color: #7d7d7d;
    font-size: 0.875rem;
    margin: 0;
}

.school-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.school-info span {
    color: #4054B2;
    font-size: 0.875rem;
}

/* ========== LOADING ANIMATION ========== */
/* Styles loading déplacés vers components-buttons.css */
/*
.btn-login.loading {
    pointer-events: none;
}

.btn-login.loading::after {
    content: '';
    position: absolute;
*/
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s ease infinite;
}

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

/* ========== LOGIN SUCCESS OVERLAY ========== */
.login-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4054B2 0%, #162C5A 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.login-success-overlay.show {
    display: flex;
    opacity: 1;
}

.welcome-message {
    text-align: center;
    color: white;
    animation: welcomeAnimation 2s ease-in-out;
}

.welcome-message h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.welcome-message p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.welcome-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
    border-radius: 20px;
    animation: logoSpinWelcome 2s linear infinite;
    box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: contain;
}

.loading-ring {
    margin: 1rem auto;
    width: 60px;
    height: 60px;
    position: relative;
}

.loading-ring::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: spinRing 1s linear infinite;
}

.loading-text {
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.8;
    animation: fadeInOut 2s ease-in-out infinite;
}

.role-badge-welcome {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1rem;
}

/* ========== WELCOME ANIMATIONS ========== */
@keyframes welcomeAnimation {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    50% {
        opacity: 1;
        transform: translateY(-10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes logoSpinWelcome {
    0% {
        transform: rotate(0deg) scale(1);
        box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2);
    }
    50% {
        transform: rotate(180deg) scale(1.05);
        box-shadow: 0 12px 40px rgba(255, 255, 255, 0.3);
    }
    100% {
        transform: rotate(360deg) scale(1);
        box-shadow: 0 8px 32px rgba(255, 255, 255, 0.2);
    }
}

@keyframes spinRing {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ========== DARK MODE - ADDITIVE ONLY ========== */
[data-theme="dark"] body {
    background-color: #0d1117;
    color: #f0f6fc;
}

[data-theme="dark"] .login-card {
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #30363d;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .login-card:hover {
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .login-subtitle {
    color: #8b949e;
}

[data-theme="dark"] .form-label-custom {
    color: #8b949e;
}

[data-theme="dark"] .form-input-custom {
    background: rgba(33, 38, 45, 0.9);
    border: 2px solid #30363d;
    color: #f0f6fc;
}

[data-theme="dark"] .form-input-custom:focus {
    background: rgba(33, 38, 45, 0.95);
    border-color: #4054B2;
}

[data-theme="dark"] .form-check {
    color: #8b949e;
}

[data-theme="dark"] .login-footer {
    border-top: 1px solid #30363d;
}

[data-theme="dark"] .login-footer p {
    color: #8b949e;
}

/* ========== BUTTON STYLES ========== */
.btn-login {
    background: linear-gradient(135deg, #4054B2 0%, #162C5A 100%);
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(64, 84, 178, 0.3);
    background: linear-gradient(135deg, #4866D0 0%, #1A3668 100%);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== PUBLIC TOOLS SECTION ========== */
.public-tools-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(22, 44, 90, 0.15);
}

.public-tools-section p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.btn-tools {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.btn-tools:hover {
    background: linear-gradient(135deg, #5a6268 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: white;
    text-decoration: none;
}

/* ========== DARK THEME OVERRIDES ========== */
[data-theme="dark"] .btn-login {
    background: linear-gradient(135deg, #4054B2 0%, #162C5A 100%);
    color: white;
    border: none;
}

[data-theme="dark"] .public-tools-section {
    border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .public-tools-section p {
    color: #8b949e;
}

/* ========== GOOGLE OAUTH BUTTON ========== */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #7d7d7d;
    font-size: 0.9rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(222, 226, 230, 0.8);
}

.divider::before {
    margin-right: 1rem;
}

.divider::after {
    margin-left: 1rem;
}

.btn-google {
    background: white;
    border: 2px solid rgba(206, 212, 218, 0.8);
    border-radius: 16px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    color: #5f6368;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    margin-bottom: 1rem;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.2);
    color: #4285f4;
    text-decoration: none;
}

.btn-google img {
    width: 20px;
    height: 20px;
}

.google-icon {
    font-size: 1.25rem;
}

[data-theme="dark"] .btn-google {
    background: rgba(33, 38, 45, 0.9);
    border: 2px solid #30363d;
    color: #f0f6fc;
}

[data-theme="dark"] .btn-google:hover {
    background: rgba(33, 38, 45, 0.95);
    border-color: #4285f4;
    color: #4285f4;
}

[data-theme="dark"] .divider {
    color: #8b949e;
}

[data-theme="dark"] .divider::before,
[data-theme="dark"] .divider::after {
    border-bottom-color: #30363d;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        border-radius: 20px;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .form-input-custom {
        padding: 1rem;
        height: 3.5rem;
        font-size: 0.95rem;
    }

    .form-label-custom {
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .form-label-custom .input-icon {
        font-size: 1rem;
    }
}

/* ========== ENHANCED RESPONSIVE FOR BACKGROUND PHOTO ========== */
@media (max-width: 768px) {
    body::before {
        background-position: 60% center;
    }

    .welcome-message h2 {
        font-size: 2rem;
    }

    .welcome-message p {
        font-size: 1.1rem;
    }

    .welcome-logo {
        width: 80px;
        height: 80px;
    }

    .loading-ring {
        width: 50px;
        height: 50px;
    }
}