/* Appliquer le bordeaux ENS sur le logo SVG du header */
/* Logo ENS bordeaux et blanc, plus grand */
/* Logo ENS bordeaux et blanc, agrandi */
.logo-ens-bordeaux {
    width: 240px;
    max-width: 80vw;
    height: auto;
    display: block;
    margin: 24px auto 1.2em auto;
    /* Aucun filtre pour respecter les couleurs du SVG */
}

/* Centrer et réduire la taille du formulaire sur la page test-login */
.login-test-centered {
    max-width: 350px;
    margin: 2.5em auto 0 auto;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
/* ============================================
   Thème CAS - École Normale Supérieure Paris
   ============================================ */

:root {
    --ens-bordeaux: #862542;
    --ens-bordeaux-dark: #6b1d35;
    --ens-bordeaux-light: #9e3a57;
    --gris-clair: #dedede;
    --gris-moyen: #dedede;
    --gris-fonce: #666666;
    --blanc: #ffffff;
    --texte-principal: #333333;
    --ombre: rgba(0, 0, 0, 0.1);
    --ombre-forte: rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--gris-clair, #dedede);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--texte-principal);
    padding: 2rem;
}

@media (max-width: 576px) {
    body {
        padding: 0;
    }
}

/* Container global pour toutes les sections */
.cas-wrapper {
    max-width: 720px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 0 20px var(--ombre-forte);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@media (max-width: 576px) {
    .cas-wrapper {
        border-radius: 0;
        box-shadow: none;
    }
}

/* ============================================
   En-tête
   ============================================ */

header {
    width: 100%;
}

.header-content {
    width: 100%;
    background: linear-gradient(to right, var(--ens-bordeaux) 0%, var(--ens-bordeaux-dark) 100%);
    color: var(--blanc);
    padding: 1.2rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

/* Agrandir le conteneur du logo dans le header */
.header-logo {
    width: 240px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 0;
    border-right: none;
}

.header-logo img {
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: contain;
    /* Aucun filtre pour respecter les couleurs du SVG */
}

header h1 {
    font-size: 1.6rem;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ============================================
   Section principale
   ============================================ */

.main-section {
    width: 100%;
    border-top: 3px solid var(--blanc);
}

.main-section-content {
    width: 100%;
    background: linear-gradient(to right, var(--ens-bordeaux) 0%, var(--ens-bordeaux-dark) 100%);
    padding: 1.2rem 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.lock-icon {
    width: 40px;
    height: 40px;
    background: var(--blanc);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(134, 37, 66, 0.3);
    border: 2px solid var(--ens-bordeaux);
}

.lock-icon img {
    width: 24px;
    height: 24px;
    filter: invert(20%) sepia(95%) saturate(1400%) hue-rotate(315deg) brightness(90%);
}

.main-section h2 {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--blanc);
}

/* ============================================
   Container principal
   ============================================ */

main {
    width: 100%;
    border-top: 3px solid var(--blanc);
    background: var(--blanc, #fff);
    padding-top: 24px;
    padding-bottom: 24px;
    min-height: unset;
    height: auto;
}

.login-container {
    width: 100%;
    max-width: 600px;
    background: var(--blanc, #fff);
    min-height: 120px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

/* ============================================
   Illustration gauche
   ============================================ */

.login-illustration {
    background: linear-gradient(to right, var(--ens-bordeaux) 0%, var(--ens-bordeaux-dark) 100%);
    background-image: url('/cas/images/illustration-lecture-3fa1a5674fa8474a2faeeec29c618f6d.svg');
    background-size: contain;
    background-position: left center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    border-right: 3px solid var(--ens-bordeaux);
}

.illustration-svg {
    width: 60%;
    max-width: 200px;
    height: auto;
    opacity: 0.4;
}

/* ============================================
   Formulaire de login
   ============================================ */

.login-form-container {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-width: 350px;
}

.login-form {
    width: 100%;
    max-width: 400px;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--texte-principal);
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    min-width: 300px;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gris-moyen);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    -webkit-appearance: none; /* Supprime le style par défaut iOS */
    -moz-appearance: none;
    appearance: none;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    outline: none;
    border-color: var(--ens-bordeaux);
    box-shadow: 0 0 0 3px rgba(134, 37, 66, 0.1), 0 4px 12px rgba(134, 37, 66, 0.15);
    transform: translateY(-1px);
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--ens-bordeaux);
}

.remember-me label {
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--gris-fonce);
}

/* ============================================
   Boutons
   ============================================ */

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.2rem;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--ens-bordeaux);
    color: var(--blanc);
    flex: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ens-bordeaux) 0%, var(--ens-bordeaux-dark) 100%);
    box-shadow: 0 6px 20px rgba(134, 37, 66, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(134, 37, 66, 0.3);
}

.btn-secondary {
    background-color: var(--gris-moyen);
    color: var(--texte-principal);
}

.btn-secondary:hover {
    background-color: var(--gris-fonce);
    color: var(--blanc);
}

/* ============================================
   Messages d'erreur et d'information
   ============================================ */

.alert {
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    position: relative;
    animation: slideDown 0.4s ease-out;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background-color: #fff5f5;
    color: #721c24;
    border-left-color: #dc3545;
}

.alert-error::before {
    content: '✕';
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    font-size: 0.9rem;
}

.alert-info {
    background-color: #f0f9ff;
    color: #0c5460;
    border-left-color: #17a2b8;
}

.alert-info::before {
    content: 'i';
    background-color: #17a2b8;
    color: white;
    font-weight: bold;
    font-style: italic;
}

.alert-success {
    background-color: #f0fdf4;
    color: #155724;
    border-left-color: #28a745;
}

.alert-success::before {
    content: '✓';
    background-color: #28a745;
    color: white;
    font-weight: bold;
}

/* ============================================
   Footer
   ============================================ */

footer {
    width: 100%;
    border-top: 3px solid var(--blanc);
}

.footer-content {
    width: 100%;
    background: linear-gradient(to right, var(--ens-bordeaux) 0%, var(--ens-bordeaux-dark) 100%);
    padding: 1.2rem 1.8rem;
    text-align: center;
    color: var(--blanc);
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.footer-content p:first-child {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

/* ============================================
   Message de sécurité
   ============================================ */

.security-warning {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #fff8e1;
    border-left: 4px solid #ffa726;
    border-radius: 4px;
    text-align: center;
}

.security-warning p {
    font-size: 0.85rem;
    color: #663c00;
    line-height: 1.5;
    margin: 0;
}

.security-warning strong {
    color: #d32f2f;
    font-weight: 700;
}

/* ============================================
   Responsive
   ============================================ */

/* Tablettes */
@media (max-width: 968px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-illustration {
        display: none;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .main-section h2 {
        font-size: 1.3rem;
    }

    .login-form-container {
        padding: 2.5rem 2rem;
        min-width: auto;
    }
}

/* Smartphones paysage */
@media (max-width: 768px) {
    .header-content {
        padding: 1.2rem 1.5rem;
        gap: 1.2rem;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

    header h1 {
        font-size: 1.3rem;
    }

    .main-section-content {
        padding: 1.2rem 1.5rem;
    }

    .lock-icon {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }

    .main-section h2 {
        font-size: 1.1rem;
    }

    .login-form-container {
        padding: 2rem 1.5rem;
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        min-width: auto;
        font-size: 16px; /* Évite le zoom automatique sur iOS */
    }
}

/* Smartphones portrait */
@media (max-width: 576px) {
    .header-content {
        padding: 1rem;
        gap: 0.8rem;
        flex-direction: row;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .header-logo img:hover {
        transform: scale(1);
    }

    header h1 {
        font-size: 1.1rem;
        letter-spacing: 0.3px;
    }

    .main-section-content {
        padding: 1rem;
        gap: 0.8rem;
    }

    .lock-icon {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }

    .main-section h2 {
        font-size: 0.95rem;
    }

    .login-container {
        min-height: auto;
    }

    .login-form-container {
        padding: 1.5rem 1rem;
    }

    .login-form {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 1.2rem;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }

    .form-group input[type="text"],
    .form-group input[type="password"] {
        padding: 0.7rem 0.8rem;
        font-size: 16px; /* Évite le zoom iOS */
        border-width: 1.5px;
    }

    .remember-me {
        margin-bottom: 1.2rem;
    }

    .remember-me label {
        font-size: 0.85rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 1.2rem;
    }

    .btn {
        width: 100%;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .alert {
        padding: 0.8rem 0.8rem 0.8rem 2.5rem;
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }

    .alert::before {
        left: 0.7rem;
        width: 18px;
        height: 18px;
    }

    .footer-content {
        padding: 1.2rem 1rem;
        font-size: 0.8rem;
    }

    .footer-content p:first-child {
        font-size: 0.75rem;
    }
}

/* Très petits écrans */
@media (max-width: 375px) {
    header h1 {
        font-size: 1rem;
    }

    .header-logo {
        width: 45px;
        height: 45px;
    }

    .main-section h2 {
        font-size: 0.9rem;
    }

    .lock-icon {
        width: 35px;
        height: 35px;
        font-size: 1.1rem;
    }

    .login-form-container {
        padding: 1.2rem 0.8rem;
    }

    .btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   Animations et effets supplémentaires
   ============================================ */

/* Animation de chargement pour le bouton */
.btn-primary.loading {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Effet de brillance au survol des champs */
.form-group input[type="text"],
.form-group input[type="password"] {
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
}

/* Transition douce pour tous les éléments interactifs */
.btn, .form-group input, .remember-me input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
