/* Page de connexion Evozia — Design sobre et professionnel */

body {
    background: linear-gradient(160deg, #EFF3F8 0%, #F5F0E8 50%, #F3F5F8 100%);
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Container principal */
.login-container {
    background: #ffffff;
    padding: 48px 40px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(14, 42, 71, 0.06), 0 10px 40px rgba(14, 42, 71, 0.08);
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(14, 42, 71, 0.06);
}

/* Header avec logo */
.login-header {
    text-align: center;
    margin-bottom: 36px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.logo-img {
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.login-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #0E2A47;
    letter-spacing: -0.02em;
    margin: 0 0 6px;
}

.login-subtitle {
    color: #C4A46C;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

/* Formulaire */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #334155;
    letter-spacing: 0.01em;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #D4DAE3;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    color: #1A2236;
    background: #FAFBFC;
    transition: all 0.2s ease;
}

.form-group input::placeholder {
    color: #94a3b8;
}

.form-group input:hover {
    border-color: #b0b9c6;
    background: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #0E2A47;
    box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.10);
    background: #ffffff;
}

/* Champ mot de passe */
.password-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-container input {
    padding-right: 44px;
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    font-size: 14px;
    padding: 6px;
    border-radius: 4px;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle:hover {
    color: #0E2A47;
}

.password-toggle:focus {
    outline: none;
    color: #0E2A47;
}

/* Bouton connexion */
.btn-login {
    width: 100%;
    background: linear-gradient(135deg, #0E2A47 0%, #1B4B7A 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 13px 24px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(14, 42, 71, 0.20);
}

.btn-login:hover:not(:disabled) {
    background: linear-gradient(135deg, #091D33 0%, #0E2A47 100%);
    box-shadow: 0 4px 16px rgba(14, 42, 71, 0.28);
    transform: translateY(-1px);
}

.btn-login:active:not(:disabled) {
    background: #091D33;
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(14, 42, 71, 0.18);
}

.btn-login:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    box-shadow: none;
}

/* Message d'erreur */
.error-message {
    background: #fef2f2;
    color: #991b1b;
    padding: 11px 14px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
    display: none;
}

/* Footer formulaire */
.login-footer {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(14, 42, 71, 0.06);
}

/* Branding bas de page */
.login-branding {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #C4A46C;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* 2FA Modal */
.mfa-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(14, 42, 71, 0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.mfa-modal {
    background: #ffffff;
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(14, 42, 71, 0.18), 0 8px 20px rgba(14, 42, 71, 0.08);
    border: 1px solid rgba(14, 42, 71, 0.06);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.mfa-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #0E2A47 0%, #1B4B7A 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #ffffff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(14, 42, 71, 0.20);
}

.mfa-modal h3 {
    color: #0f172a;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 18px;
}

.mfa-modal p {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 24px;
}

.mfa-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 20px;
    font-family: 'Inter', monospace;
    text-align: center;
    letter-spacing: 6px;
    margin-bottom: 16px;
    color: #1e293b;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mfa-input:focus {
    outline: none;
    border-color: #0E2A47;
    box-shadow: 0 0 0 3px rgba(14, 42, 71, 0.10);
}

/* Responsive — Tablet (768px) */
@media (max-width: 768px) {
    .login-page {
        padding: 20px 16px;
    }

    .login-container {
        max-width: 400px;
        padding: 40px 32px 36px;
        border-radius: 12px;
        box-shadow: 0 2px 10px rgba(14, 42, 71, 0.06), 0 6px 24px rgba(14, 42, 71, 0.06);
    }

    .login-header {
        margin-bottom: 28px;
    }

    .logo-img {
        width: 50px;
        height: 50px;
    }

    .login-title {
        font-size: 22px;
    }

    /* Touch-friendly password toggle — 44px minimum */
    .password-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
        font-size: 16px;
    }

    /* Touch-friendly form inputs */
    .form-group input {
        padding: 14px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .form-group label {
        font-size: 14px;
    }

    .password-input-container input {
        padding-right: 48px;
    }

    /* Larger MFA input for finger tapping */
    .mfa-input {
        padding: 16px 16px;
        font-size: 24px;
        letter-spacing: 8px;
        min-height: 56px;
    }

    .mfa-modal {
        width: 92%;
        max-width: 400px;
        padding: 36px 28px;
    }

    /* Touch-friendly login button */
    .btn-login {
        padding: 16px 24px;
        font-size: 15px;
        min-height: 48px;
    }

    /* Simplify background for performance */
    body {
        background: #F3F5F8;
    }

    /* Minimum font size 14px on mobile */
    .login-footer {
        font-size: 12px;
    }

    .error-message {
        font-size: 14px;
    }
}

/* Responsive — Small phones (480px) */
@media (max-width: 480px) {
    .login-page {
        padding: 16px 12px;
    }

    .login-container {
        padding: 36px 24px 32px;
        border-radius: 10px;
        box-shadow: 0 2px 8px rgba(14, 42, 71, 0.05);
    }

    .logo-img {
        width: 44px;
        height: 44px;
    }

    .login-title {
        font-size: 20px;
    }

    .login-subtitle {
        font-size: 11px;
    }

    .mfa-modal {
        margin: 16px;
        padding: 28px 20px;
        border-radius: 12px;
    }

    .mfa-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    /* Reduce visual complexity */
    .login-container {
        border: none;
    }

    .mfa-modal {
        box-shadow: 0 10px 40px rgba(14, 42, 71, 0.15);
        border: none;
    }
}

/* Responsive — Very small screens (320px) */
@media (max-width: 320px) {
    .login-page {
        padding: 12px 8px;
    }

    .login-container {
        padding: 28px 16px 24px;
        border-radius: 8px;
    }

    .login-header {
        margin-bottom: 20px;
    }

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

    .login-title {
        font-size: 18px;
    }

    .login-subtitle {
        font-size: 10px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-group label {
        font-size: 13px;
        margin-bottom: 4px;
    }

    .form-group input {
        padding: 12px;
        font-size: 15px;
    }

    .btn-login {
        padding: 14px 16px;
        font-size: 14px;
    }

    .mfa-modal {
        margin: 10px;
        padding: 24px 16px;
    }

    .mfa-input {
        padding: 14px 12px;
        font-size: 20px;
        letter-spacing: 6px;
    }

    .login-branding {
        margin-top: 20px;
        font-size: 11px;
    }

    .login-footer {
        font-size: 11px;
        margin-top: 16px;
        padding-top: 14px;
    }
}

/* All mobile — prevent horizontal scroll */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
}
