/* Page login: look&feel aligné sur le dashboard BDE (fond sombre + card + boutons .btn) */

body.stages-bde {
    min-height: 100vh;
}

.auth-main {
    min-height: calc(100vh - 86px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px 16px 28px;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    border-radius: 12px;
    padding: 22px 22px 18px;
    background: rgba(15, 23, 42, 0.60);
    border: 1px solid rgba(148, 163, 184, 0.20);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
}

.auth-card:hover {
    border-color: rgba(148, 163, 184, 0.30);
}

.auth-title {
    margin: 0 0 8px;
    font-size: 19px;
    font-weight: 700;
    color: #f9fafb;
    letter-spacing: 0.01em;
}

.auth-subtitle {
    margin: 0 0 14px;
    color: #9ca3af;
    font-size: 13px;
}

.auth-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #e5e7eb;
    font-weight: 500;
}

.auth-field input[type="email"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.60);
    color: #f9fafb;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.auth-field input[type="email"]:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

.auth-field input[type="email"]::placeholder {
    color: #9ca3af;
    opacity: 0.9;
}

.auth-actions {
    margin-top: 14px;
    display: grid;
    gap: 10px;
}

/* Boutons: match visuel BDE (pas de pill géant sur la page login) */
.auth-actions .btn {
    border-radius: 10px;
    padding: 10px 14px;
}

.auth-partner-switch {
    margin: 1rem 0 0;
    text-align: center;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #94a3b8;
}

.auth-partner-switch a {
    color: #cbd5e1;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(203, 213, 225, 0.35);
    text-underline-offset: 2px;
}

.auth-partner-switch a:hover,
.auth-partner-switch a:focus-visible {
    color: #e2e8f0;
    text-decoration-color: rgba(147, 197, 253, 0.65);
    outline: none;
}

.auth-footer {
    margin-top: 14px;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    opacity: 0.9;
}

.auth-footer-hint {
    margin: 0 0 10px;
    line-height: 1.35;
}

.auth-footer-credits {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    line-height: 1.45;
    font-weight: 500;
    color: #cbd5e1;
}

.auth-footer-credits a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(203, 213, 225, 0.4);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease, text-shadow 0.25s ease;
}

.auth-footer-credits a:hover {
    text-decoration-color: rgba(147, 197, 253, 0.75);
    text-shadow:
        0 0 6px rgba(96, 165, 250, 0.95),
        0 0 14px rgba(59, 130, 246, 0.65),
        0 0 26px rgba(37, 99, 235, 0.4);
}

.auth-footer-credits a:focus-visible {
    outline: none;
    text-decoration-color: rgba(147, 197, 253, 0.9);
    text-shadow:
        0 0 6px rgba(96, 165, 250, 0.95),
        0 0 14px rgba(59, 130, 246, 0.65),
        0 0 26px rgba(37, 99, 235, 0.4);
}

.auth-footer-school {
    margin-top: 8px;
    opacity: 0.95;
}

/* Icône Font Awesome + texte sur une même ligne (le <div> du message est bloc par défaut) */
.auth-card .flash {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.auth-card .flash > i {
    flex-shrink: 0;
}

.auth-card .flash > div {
    flex: 1;
    min-width: 0;
    margin: 0;
}

.auth-alt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 14px;
    margin-top: 12px;
}

.auth-alt .header-user-action,
.auth-email-summary .header-user-action {
    color: #93c5fd;
    font-size: 13px;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    line-height: inherit;
}

.auth-alt .header-user-action:hover,
.auth-email-summary .header-user-action:hover {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.15);
}

#login-totp-form {
    margin-top: 16px;
}

#login-totp-form .auth-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 6px;
    border: 1px solid rgba(148, 163, 184, 0.30);
    background: rgba(15, 23, 42, 0.60);
    color: #f9fafb;
    font-size: 14px;
    outline: none;
}

#login-totp-form .auth-field input:focus {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
}

/* Carrousel auth (Task 3 markup) */
.auth-carousel {
    overflow: hidden;
    width: 100%;
}

.auth-carousel-track {
    display: flex;
    width: 200%;
    transform: translateX(0);
    transition: transform 0.35s ease;
}

.auth-carousel.is-methods .auth-carousel-track {
    transform: translateX(-50%);
}

.auth-panel {
    width: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 2px; /* éviter coupe focus ring */
}

/* Étape email : titre/sous-titre en haut ; formulaire centré dans l’espace restant
   (hauteur du track souvent calée sur le panneau méthodes). */
#login-email-panel.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

#login-email-panel .auth-title,
#login-email-panel .auth-subtitle {
    flex-shrink: 0;
}

#login-email-panel #login-email-form {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

@media (prefers-reduced-motion: reduce) {
    .auth-carousel-track {
        transition: none;
    }

    .auth-method-tile {
        transition: none;
    }

    .auth-method-tile:active {
        transform: none;
    }
}

.auth-method-tiles {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.auth-method-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.55);
    color: #f9fafb;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.auth-method-tile:hover,
.auth-method-tile:focus-visible {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(30, 41, 59, 0.75);
    outline: none;
}

.auth-method-tile:active {
    transform: scale(0.99);
}

.auth-method-tile-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    color: #93c5fd;
    line-height: 1;
    font-size: 1.125rem;
}

.auth-method-tile strong {
    display: block;
    font-size: 14px;
}

.auth-method-tile span {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.auth-totp-subview[hidden] {
    display: none !important;
}

.auth-email-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #cbd5e1;
}
