/* =========================================
   Jul-IA 4.0 - Design System Complet
   ========================================= */
:root {
    --bg-dark: #07070a;
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --text-white: #ffffff;
    --text-dim: #94a3b8;
    --glass-bg: rgba(15, 15, 25, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-radius: 28px;
    --btn-radius: 14px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

#backgroundCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2 !important;
    pointer-events: none;
}

.orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.3;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary);
    bottom: -100px;
    right: -100px;
}

/* =========================================
   CONTENEUR & SCREENS
   ========================================= */
.login-container {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 1000px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
    border-radius: var(--card-radius);
    overflow: hidden;
    display: flex;
    min-height: 600px;
}

.welcome-screen {
    display: flex;
    width: 100%;
    transition: 0.5s;
}

.welcome-screen.hidden {
    display: none !important;
}

.welcome-content {
    flex: 1.2;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.welcome-visual {
    flex: 0.8;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-screen {
    display: none;
    width: 100%;
    padding: 4rem;
    max-width: 700px;
    margin: 0 auto;
}

.form-screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transform: none;
    opacity: 1;
}

/* =========================================
   TYPOGRAPHIE
   ========================================= */
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.welcome-title,
.question-title {
    font-family: 'Clash Display', sans-serif;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(to bottom right, #fff, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
}

.question-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.welcome-subtitle,
.subtitle {
    font-size: 1.1rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 2rem;
}

/* =========================================
   BOUTONS (LE FIX)
   ========================================= */

/* Style de base pour TOUS les boutons */
button {
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Boutons d'accueil */
.btn-primary {
    padding: 1.1rem 2.2rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px var(--primary-glow);
    background: var(--primary-light);
}

.btn-secondary {
    padding: 1.1rem 2.2rem;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Boutons de navigation (Formulaire) */
.nav-area {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
}

.nav-btn {
    padding: 1rem 2rem;
    border-radius: var(--btn-radius);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    flex: 1;
}

.nav-btn.primary {
    background: white;
    color: black;
}

.nav-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

.nav-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid var(--glass-border);
}

.nav-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Bouton Retour (back) */
.back-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2rem;
    padding: 0;
    width: fit-content;
}

.back-btn:hover {
    color: white;
    transform: translateX(-5px);
}

/* Bouton Oeil (Password) */
.password-container {
    position: relative;
    width: 100%;
}

.toggle-password-btn {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    padding: 5px;
}

.toggle-password-btn:hover {
    color: white;
}

/* Tags d'intérêts */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin: 1rem 0;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.interest-tag {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: 0.2s;
}

.interest-tag.selected {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* =========================================
   INPUTS & PROGRESS
   ========================================= */
.progress-container {
    background: rgba(255, 255, 255, 0.05);
    height: 6px;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.progress-bar {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: 0.5s;
}

.modern-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 1.2rem;
    border-radius: 14px;
    color: white;
    font-size: 1.1rem;
    outline: none;
    margin-bottom: 1rem;
}

.modern-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
}

.logo-3d {
    width: 220px;
    filter: drop-shadow(0 0 30px var(--primary-glow));
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.footer-link {
    text-align: center;
    margin-top: 2rem;
    color: var(--text-dim);
}

.footer-link a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
}

.error-msg {
    color: #f87171;
    font-size: 0.95rem;
    margin-top: 10px;
    font-weight: 500;
    height: 20px;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .login-container {
        width: 95%;
        flex-direction: column;
        min-height: auto;
        margin: 2rem 0;
    }

    .welcome-content {
        padding: 2.5rem 1.5rem;
        text-align: center;
        align-items: center;
    }

    .welcome-visual {
        display: none;
    }

    .action-buttons {
        flex-direction: column;
        width: 100%;
    }

    .form-screen {
        padding: 3rem 1.5rem;
    }
}