/* =========================================================================
   ExtrAvnir — Pages d'authentification (login / register / récupération)
   Style moderne glass-morphism par-dessus Fond_login.png
   ========================================================================= */

:root {
    --avnir-blue: #0070b8;
    --avnir-blue-dark: #005a90;
    --avnir-blue-deep: #003e63;
    --avnir-orange: #f39200;
    --avnir-orange-soft: #ff9a3c;
    --text-dark: #1a2a3a;
    --text-muted: #5a6a78;
    --card-bg: rgba(255, 255, 255, 0.78);
    --card-border: rgba(255, 255, 255, 0.55);
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: rgba(0, 112, 184, 0.18);
    --input-border-focus: var(--avnir-blue);
    --shadow-soft: 0 10px 40px rgba(0, 30, 60, 0.25);
    --shadow-strong: 0 20px 60px rgba(0, 30, 60, 0.35);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-image:
        linear-gradient(
            180deg,
            rgba(0, 30, 60, 0.45) 0%,
            rgba(0, 30, 60, 0.15) 35%,
            rgba(0, 30, 60, 0.55) 100%
        ),
        url('/static/Fond_login.png');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Carte centrale en verre dépoli */
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 36px 32px 28px;
    box-shadow: var(--shadow-strong);
    animation: cardIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-card.wide {
    max-width: 480px;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* En-tête : logo + titre */
.auth-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-logo {
    max-width: 200px;
    width: 70%;
    height: auto;
    margin: 0 auto 14px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.15));
}

.auth-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--avnir-blue-deep);
}

.auth-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Messages flash */
.flash-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.flash-list li,
.flash-message {
    background: rgba(0, 112, 184, 0.08);
    border: 1px solid rgba(0, 112, 184, 0.25);
    color: var(--avnir-blue-deep);
    padding: 10px 14px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13.5px;
    line-height: 1.45;
}

.flash-message.error {
    background: rgba(220, 53, 69, 0.10);
    border-color: rgba(220, 53, 69, 0.35);
    color: #8b1a25;
}

.flash-message.success {
    background: rgba(40, 167, 69, 0.12);
    border-color: rgba(40, 167, 69, 0.35);
    color: #1c5b2d;
}

/* Formulaire */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field {
    position: relative;
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    padding: 13px 14px;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--text-dark);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    font-family: inherit;
}

.auth-form input::placeholder {
    color: #9aa6b2;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--input-border-focus);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(0, 112, 184, 0.15);
}

/* Case à cocher (register) */
.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 6px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--avnir-blue);
    cursor: pointer;
}

.form-check label {
    font-size: 14px;
    color: var(--text-dark);
    cursor: pointer;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
}

/* Bouton principal */
.btn-primary {
    margin-top: 6px;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, var(--avnir-blue) 0%, var(--avnir-blue-dark) 100%);
    box-shadow: 0 8px 20px rgba(0, 112, 184, 0.35);
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
    font-family: inherit;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(0, 112, 184, 0.45);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 6px 14px rgba(0, 112, 184, 0.35);
}

/* Liens secondaires sous le formulaire */
.auth-links {
    margin-top: 18px;
    text-align: center;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.7;
}

.auth-links a {
    color: var(--avnir-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s ease;
}

.auth-links a:hover {
    color: var(--avnir-orange);
    text-decoration: underline;
}

.auth-links .separator {
    display: inline-block;
    margin: 0 8px;
    color: rgba(0, 0, 0, 0.25);
}

/* Pied de carte */
.auth-footer {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--text-muted);
    text-decoration: underline;
}

.auth-footer a:hover {
    color: var(--avnir-blue);
}

/* Petit liseré orange en haut de la carte (accent marque) */
.auth-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--avnir-blue), var(--avnir-orange));
    border-radius: 0 0 6px 6px;
}

.auth-card {
    position: relative;
}

/* Responsive */
@media (max-width: 520px) {
    .auth-card {
        padding: 28px 22px 22px;
        border-radius: 18px;
    }
    .auth-title {
        font-size: 19px;
    }
    .auth-logo {
        max-width: 160px;
    }
    .auth-form input[type="text"],
    .auth-form input[type="email"],
    .auth-form input[type="password"] {
        padding: 12px 12px;
        font-size: 14.5px;
    }
    .btn-primary {
        padding: 12px 16px;
        font-size: 14.5px;
    }
}

@media (max-height: 720px) {
    body {
        align-items: flex-start;
        padding-top: 32px;
        padding-bottom: 32px;
    }
}

/* Safari fallback si pas de backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-card {
        background: rgba(255, 255, 255, 0.92);
    }
}
