:root {
    --brand-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }

        /* Bouton de retour */
        .close-btn {
            position: fixed;
            top: 20px;
            right: 20px;
            width: 45px;
            height: 45px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            color: #667eea;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            font-weight: bold;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            z-index: 1001;
        }

        .close-btn:hover {
            background: #dc3545;
            color: white;
            border-color: #dc3545;
            transform: scale(1.1) rotate(90deg);
        }

        /* Header */
        header {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 0;
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
        }

        .nav-container {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0 1rem;
        }

        .logo {
            font-size: 1.8rem;
            font-weight: bold;
            color: #667eea;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .logo-image {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            object-fit: cover;
            transition: all 0.3s ease;
            border: 2px solid rgba(0, 212, 255, 0.3);
        }

        .logo:hover .logo-image {
            border-color: rgba(0, 212, 255, 0.6);
            box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
        }

        /* Main Content */
        .main-content {
            padding: 100px 0 40px;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
        }

        .login-container {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(20px);
            padding: 2rem;
            border-radius: 20px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
            width: 100%;
            max-width: 400px;
            margin: 0 1rem;
            animation: fadeInUp 0.8s ease;
        }

        .login-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .login-header h1 {
            color: #667eea;
            font-size: 2.2rem;
            margin-bottom: 0.5rem;
            font-weight: 700;
        }

        .login-header p {
            color: #666;
            font-size: 1rem;
        }

        .form-group {
            margin-bottom: 1.2rem;
        }

        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: #333;
            font-weight: 600;
            font-size: 0.9rem;
        }

        .form-group input {
            width: 100%;
            padding: 0.9rem;
            border: 2px solid #e1e5e9;
            border-radius: 12px;
            font-size: 1rem;
            transition: all 0.3s ease;
            background: white;
            -webkit-appearance: none;
            -moz-appearance: none;
        }

        .form-group input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
            transform: translateY(-2px);
        }

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

        .password-container {
            position: relative;
        }

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

        .password-toggle:hover {
            color: #667eea;
        }

        .password-toggle svg {
            width: 18px;
            height: 18px;
            display: block;
            pointer-events: none;
        }

        .form-options {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            gap: 1rem;
        }

        .remember-me {
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .remember-me input[type="checkbox"] {
            width: auto;
            margin: 0;
            transform: scale(1.1);
            accent-color: #667eea;
        }

        .remember-me label {
            margin: 0;
            font-size: 0.85rem;
            color: #555;
            cursor: pointer;
        }

        .forgot-password {
            color: #667eea;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 600;
        }

        .forgot-password:hover {
            text-decoration: underline;
        }

        .btn {
            width: 100%;
            padding: 1rem;
            border: none;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            -webkit-appearance: none;
            -moz-appearance: none;
        }

        .btn-primary {
            background: var(--brand-gradient);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-3px);
            box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        /* Conteneur Google */
        .google-signin-container {
            margin: 1rem 0;
            width: 100%;
        }

        .divider {
            text-align: center;
            margin: 1.5rem 0;
            position: relative;
            color: #999;
            font-size: 0.9rem;
        }

        .divider::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 0;
            right: 0;
            height: 1px;
            background: #e1e5e9;
            z-index: 1;
        }

        .divider span {
            background: rgba(255, 255, 255, 0.95);
            padding: 0 1rem;
            position: relative;
            z-index: 2;
        }

        /* Styles pour le bouton Google personnalisé */
        .btn-google {
            width: 100%;
            background-color: #fff;
            color: #444;
            border: 1px solid #ddd;
            border-radius: 12px;
            padding: 0.9rem;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            font-weight: 500;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            text-decoration: none;
            font-family: inherit;
        }

        .btn-google:hover {
            background-color: #f8f9fa;
            transform: translateY(-1px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            color: #444;
        }

        .btn-google:active {
            transform: translateY(0);
        }

        .google-logo {
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        /* Styles pour le bouton Microsoft */
        .microsoft-signin-container {
            margin: 1rem 0;
            width: 100%;
        }

        .btn-microsoft {
            width: 100%;
            background-color: #fff;
            color: #444;
            border: 1px solid #ddd;
            border-radius: 12px;
            padding: 0.9rem;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            font-weight: 500;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            text-decoration: none;
        }

        .btn-microsoft:hover {
            background-color: #f8f9fa;
            transform: translateY(-1px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
            text-decoration: none;
            color: #444;
        }

        .btn-microsoft:active {
            transform: translateY(0);
        }

        .microsoft-logo {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: 1fr 1fr;
            gap: 1px;
            width: 16px;
            height: 16px;
            flex-shrink: 0;
        }

        .microsoft-square {
            width: 100%;
            height: 100%;
            border-radius: 1px;
        }

        .signup-link {
            text-align: center;
            color: #666;
            font-size: 0.9rem;
            margin-top: 1rem;
        }

        .signup-link a {
            color: #667eea;
            text-decoration: none;
            font-weight: 600;
            margin-left: 0.3rem;
        }

        .signup-link a:hover {
            text-decoration: underline;
        }

        .error-message {
            background: #fee;
            color: #c33;
            padding: 0.75rem;
            border-radius: 10px;
            margin-bottom: 1rem;
            font-size: 0.9rem;
            border-left: 4px solid #c33;
            display: none;
        }

        .success-message {
            background: #efe;
            color: #363;
            padding: 0.75rem;
            border-radius: 10px;
            margin-bottom: 1rem;
            font-size: 0.9rem;
            border-left: 4px solid #363;
            display: none;
        }

        /* Footer */
        footer {
            background: #333;
            color: white;
            padding: 1.5rem 0;
            text-align: center;
            font-size: 0.9rem;
        }

        .footer-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 1rem;
        }

        /* Animations */
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .floating {
            animation: floating 3s ease-in-out infinite;
        }

        @keyframes floating {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-6px); }
        }

        .loading-spinner {
            display: none;
            width: 18px;
            height: 18px;
            border: 2px solid #ffffff;
            border-top: 2px solid transparent;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        /* Responsive Mobile (jusqu'à 480px) */
        @media (max-width: 480px) {
            body {
                font-size: 14px;
            }

            .main-content {
                padding: 90px 0 20px;
            }

            .login-container {
                padding: 1.5rem;
                margin: 0 0.5rem;
                border-radius: 15px;
            }

            .login-header h1 {
                font-size: 1.8rem;
            }

            .login-header p {
                font-size: 0.9rem;
            }

            .logo {
                font-size: 1.5rem;
            }

            .logo-image {
                width: 35px;
                height: 35px;
            }

            .form-group input {
                padding: 0.8rem;
                font-size: 16px; /* Évite le zoom sur iOS */
            }

            .btn {
                padding: 0.9rem;
                font-size: 0.95rem;
            }

            .btn-google {
                padding: 0.8rem;
                font-size: 0.9rem;
            }

            .google-logo {
                width: 14px;
                height: 14px;
            }

            .btn-microsoft {
                padding: 0.8rem;
                font-size: 0.9rem;
            }

            .microsoft-logo {
                width: 14px;
                height: 14px;
            }

            .form-options {
                flex-direction: column;
                align-items: stretch;
                gap: 0.8rem;
            }

            .remember-me {
                justify-content: center;
            }

            .forgot-password {
                text-align: center;
            }

            .remember-me label,
            .forgot-password {
                font-size: 0.8rem;
            }

            footer {
                padding: 1rem 0;
                font-size: 0.8rem;
            }
        }

        /* Responsive Tablette */
        @media (min-width: 481px) and (max-width: 768px) {
            .login-container {
                max-width: 450px;
                padding: 2.5rem;
            }

            .login-header h1 {
                font-size: 2rem;
            }
        }

        /* Amélioration pour les appareils avec touch */
        @media (hover: none) and (pointer: coarse) {
            .btn:hover,
            .btn-google:hover,
            .btn-microsoft:hover,
            .password-toggle:hover {
                transform: none;
            }

            .btn:active,
            .btn-google:active,
            .btn-microsoft:active {
                transform: scale(0.98);
            }

            .form-group input:focus {
                transform: none;
            }
        }


        /* Styles pour le bouton Google personnalisé */
        .btn-google {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            gap: 12px;
            background: white;
            border: 1px solid #dadce0;
            color: #3c4043;
            text-decoration: none;
            transition: all 0.2s ease;
        }

        .btn-google:hover {
            background: #f8f9fa;
            border-color: #d2d3d4;
            box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
        }
