:root {
    --primary-color: #0071e3;
    --primary-hover: #0077ed;
    --primary-active: #0062c4;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.6);
    --input-bg: rgba(255, 255, 255, 0.85);
    --input-border: rgba(0, 0, 0, 0.12);
    --input-focus-border: #0071e3;
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    --radius-card: 24px;
    --radius-input: 14px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    color: var(--text-main);
    
    /* === Fond d'écran : Détecte automatiquement ../images/wallpaper.jpg avec fallback moderne === */
    background: 
        url('../images/wallpaper.jpg') center/cover no-repeat fixed,
        radial-gradient(circle at 15% 15%, rgba(0, 113, 227, 0.1) 0%, transparent 45%),
        radial-gradient(circle at 85% 85%, rgba(94, 92, 230, 0.1) 0%, transparent 45%),
        linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    padding: 24px;
    overflow-x: hidden;
}

/* Effet de profondeur / flou subtil prêt pour le fond d'écran */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
    pointer-events: none;
}

/* Centrage parfait vertical & horizontal */
.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInScale 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.title {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-main);
    text-align: center;
    margin-bottom: 26px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.login-card {
    width: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 38px 30px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
}

.error-message {
    background: rgba(255, 59, 48, 0.1);
    color: #d70015;
    border: 1px solid rgba(255, 59, 48, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s ease-in-out;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-input {
    width: 100%;
    height: 48px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-input);
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-input:focus {
    background: #ffffff;
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

/* Cloudflare Turnstile */
.turnstile-container {
    margin-bottom: 18px;
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 65px;
}

.btn-submit {
    width: 100%;
    height: 48px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-active) 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    border: none;
    border-radius: var(--radius-input);
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 113, 227, 0.28);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    background: linear-gradient(180deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.38);
    transform: translateY(-1px);
}

.btn-submit:active {
    transform: translateY(1px) scale(0.99);
    box-shadow: 0 2px 8px rgba(0, 113, 227, 0.25);
}

/* Footer Copyright Lefranc-SA */
.login-footer {
    margin-top: 24px;
    text-align: center;
}

.login-footer p {
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: -0.01em;
    font-weight: 400;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.8);
}

/* Animations */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.97) translateY(12px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }\n    20%, 60% { transform: translateX(-4px); }\n    40%, 80% { transform: translateX(4px); }\n}\n\n@media (max-width: 480px) {\n    .title {\n        font-size: 1.85rem;\n        margin-bottom: 20px;\n    }\n    .login-card {\n        padding: 30px 20px;\n        border-radius: 20px;\n    }\n}\n