/* ============================================================
   RESET
   ============================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* ============================================================
   CORPS - AVEC IMAGE D'ARRIÈRE-PLAN
   ============================================================ */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
    
    background-image: url('assets/campus.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body {
    background-color: #f0f2f5;
}

/* ============================================================
   CARTE BLANCHE - COMPACTE
   ============================================================ */
.container {
    background: white;
    padding: 25px 35px 20px 35px;
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    margin: auto;
    text-align: center;
}

/* ============================================================
   LOGO - PLUS PETIT
   ============================================================ */
.logo-container {
    margin-bottom: 10px;
}
.logo {
    max-width: 90px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ============================================================
   TITRE - PLUS PETIT ET RESSERRÉ
   ============================================================ */
h1 {
    font-size: 15px;
    color: #003366;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 0.3px;
    line-height: 1.3;
    word-break: break-word;
}

/* ============================================================
   CHAMPS - RESSERRÉS
   ============================================================ */
.input-group {
    margin-bottom: 12px;
    text-align: left;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #fafbfc;
    -webkit-appearance: none;
    appearance: none;
}

input:focus {
    border-color: #003366;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.15);
    background: white;
}

/* ============================================================
   CHAMPS EN ERREUR
   ============================================================ */
input.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

/* ============================================================
   MESSAGE D'ERREUR - COMPACT
   ============================================================ */
.error-message {
    color: #dc3545;
    font-size: 12px;
    font-weight: 500;
    min-height: 18px;
    margin-bottom: 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* ============================================================
   BOUTON - COMPACT
   ============================================================ */
button {
    width: 100%;
    padding: 10px;
    background: #003366;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    letter-spacing: 1px;
    -webkit-tap-highlight-color: transparent;
}

button:hover {
    background: #002244;
}

button:active {
    transform: scale(0.98);
}

/* ============================================================
   LIENS - COMPACTS
   ============================================================ */
.links {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 4px;
}

.links a {
    color: #003366;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 2px 0;
}

.links a:hover {
    color: #0055aa;
    text-decoration: underline;
}

/* ============================================================
   PIED DE PAGE - COMPACT
   ============================================================ */
.footer-text {
    margin-top: 14px;
    font-size: 10px;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 480px) {
    .container {
        padding: 18px 18px 15px 18px;
        max-width: 100%;
        margin: 10px;
        border-radius: 8px;
    }

    h1 {
        font-size: 14px;
        margin-bottom: 14px;
    }

    input {
        font-size: 15px;
        padding: 10px 10px;
    }

    button {
        padding: 12px;
        font-size: 13px;
    }

    .links {
        font-size: 11px;
        flex-direction: row;
        justify-content: space-between;
    }

    .logo {
        max-width: 75px;
    }

    .footer-text {
        font-size: 9px;
        margin-top: 12px;
        padding-top: 10px;
    }

    .error-message {
        font-size: 11px;
        min-height: 16px;
    }
}

@media (max-width: 380px) {
    .container {
        padding: 14px 12px 12px 12px;
        margin: 5px;
    }

    h1 {
        font-size: 12px;
    }

    .links {
        flex-direction: column;
        align-items: center;
        gap: 3px;
    }

    .logo {
        max-width: 60px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 25px 30px 20px 30px;
        max-width: 350px;
    }
}

@media (min-width: 1200px) {
    .container {
        padding: 30px 40px 25px 40px;
        max-width: 400px;
    }
}

@supports (-webkit-touch-callout: none) {
    input {
        font-size: 16px !important;
    }
}