/* ================= VARIABLES ================= */
:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #06b6d4;
    --primary-hover: #0891b2;
    --secondary: #0ea5e9;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-glow: rgba(6, 182, 212, 0.3);
    --gradient: linear-gradient(135deg, #06b6d4, #0ea5e9);
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Arrière-plan animé */
.bg-glow {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    z-index: -1;
    animation: pulse 10s infinite alternate;
}
.glow-1 { top: -100px; left: -100px; background: var(--primary); }
.glow-2 { bottom: -100px; right: -100px; background: var(--secondary); }

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.15; }
    100% { transform: scale(1.2); opacity: 0.25; }
}

/* ================= AUTH BOX ================= */
.auth-container {
    width: 100%;
    max-width: 440px;
}

.auth-box {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 24px;
    padding: 40px 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(6, 182, 212, 0.1);
    text-align: center;
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-header {
    margin-bottom: 30px;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 20px;
    transition: 0.3s;
}
.logo-link:hover { color: var(--secondary); }

.auth-box h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header > p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ================= FORMULAIRE ================= */
.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    transition: 0.3s;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    padding: 16px 48px 16px 48px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid rgba(6, 182, 212, 0.2);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.input-group input::placeholder {
    color: #64748b;
}

.input-group:focus-within .input-icon {
    color: var(--primary);
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.15);
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: 0.3s;
    z-index: 2;
}
.toggle-password:hover { color: var(--text-main); }

/* ================= INDICATEUR DE FORCE ================= */
.password-strength {
    margin-top: -10px;
    margin-bottom: 25px;
    text-align: left;
}

.strength-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    background: var(--danger);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
    transition: 0.3s;
}

/* ================= BOUTONS ================= */
button {
    width: 100%;
    padding: 16px;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.6);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ================= SÉPARATEUR "OU" (Nouveau) ================= */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 25px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.divider span {
    padding: 0 15px;
}

/* ================= BOUTON GOOGLE (Nouveau) ================= */
.btn-google {
    width: 100%;
    padding: 16px;
    background: #ffffff;
    color: #1f2937;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-google:hover:not(:disabled) {
    background: #f9fafb;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-google img {
    width: 20px;
    height: 20px;
}

/* ================= FOOTER ================= */
.auth-footer {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.switch {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.switch a, .terms a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.switch a:hover, .terms a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.terms {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* ================= TOAST ================= */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    border: 1px solid rgba(148, 163, 184, 0.5);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 90%;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 20px rgba(16, 185, 129, 0.3);
}
.toast.success .toast-icon { color: var(--success); }

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5), 0 0 20px rgba(239, 68, 68, 0.3);
}
.toast.error .toast-icon { color: var(--danger); }

/* ================= RESPONSIVE ================= */
@media (max-width: 500px) {
    .auth-box {
        padding: 30px 20px;
    }
    .auth-box h1 {
        font-size: 24px;
    }
}