/* ============================================
   LIDEO COLLISION — Page d'identification
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background-color: #1a1a2e;
    color: #111827;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* ============================================
   VIDÉO DE FOND
   ============================================ */
.video-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: #1a1a2e;
}

.video-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.video-bg video.loaded {
    opacity: 1;
}

.video-bg video.fading {
    opacity: 0;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        rgba(17, 24, 39, 0.75) 0%,
        rgba(17, 24, 39, 0.55) 50%,
        rgba(239, 111, 108, 0.25) 100%
    );
}

/* ============================================
   HEADER
   ============================================ */
.header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    position: relative;
    z-index: 2;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: 48px;
}

/* ============================================
   FORMULAIRE DE LOGIN
   ============================================ */
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    position: relative;
    z-index: 2;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: #fef2f2;
    margin-bottom: 24px;
}

.login-icon svg {
    width: 32px;
    height: 32px;
    color: #ef6f6c;
    stroke: #ef6f6c;
}

.login-card h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.login-card h2 {
    font-size: 14px;
    font-weight: 400;
    color: #6b7280;
    margin-bottom: 32px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field label {
    display: block;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-field input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-field input:focus {
    border-color: #ef6f6c;
    box-shadow: 0 0 0 3px rgba(239, 111, 108, 0.15);
}

.form-field input::placeholder {
    color: #9ca3af;
}

/* Wrapper mot de passe avec bouton oeil */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s;
}

.toggle-password:hover {
    color: #6b7280;
}

.btn-login {
    width: 100%;
    height: 44px;
    background-color: #ef6f6c;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.15s;
    margin-top: 8px;
}

.btn-login:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-login:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none;
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.hidden { display: none !important; }

/* MFA — actions secondaires (renvoi / retour) */
.mfa-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 14px;
}

.mfa-action-form { display: contents; }

.btn-mfa-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn-mfa-link:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #ef6f6c;
}

.btn-mfa-link svg {
    flex-shrink: 0;
}

.btn-mfa-link-secondary {
    color: #6b7280;
}

.btn-mfa-link-secondary:hover {
    color: #374151;
}

/* Page bloqué */
.bloque-icon { background-color: #fef2f2; }
.bloque-titre { color: #dc2626; }
.bloque-retour {
    display: inline-block;
    margin-top: 24px;
    color: #ef6f6c;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

/* Page erreur (404/403) */
body.page-erreur {
    background-color: #f9fafb;
}

/* Erreur */
.login-error {
    margin-top: 16px;
    padding: 12px 16px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 16px 24px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.footer p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        margin: 0 8px;
    }

    .header-logo img {
        height: 40px;
    }
}
