:root {
    /* Colors */
    --primary: #002366;
    --primary-light: #003399;
    --primary-dark: #001a4d;
    --secondary: #FF6600;
    --secondary-hover: #E65C00;
    --white: #FFFFFF;
    --gray-light: #F8FAFC;
    --gray-medium: #E2E8F0;
    --gray-dark: #64748B;
    --text-dark: #0F172A;
    --text-body: #334155;
    --text-muted: #64748B;
    --success: #10B981;
    --danger: #EF4444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --shadow-premium: 0 25px 50px -12px rgb(0 0 0 / 0.15);

    /* Transitions & Radius */
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Empêche tout débordement horizontal (blobs décoratifs, halos, etc.) sur mobile. */
html, body { overflow-x: hidden; max-width: 100%; }

/* Les zones de texte ne se redimensionnent pas au coin (poignée retirée). */
textarea { resize: none; }

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-body);
    line-height: 1.6;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--primary); font-weight: 800; line-height: 1.2; }

.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 1.5rem; 
    width: 100%; 
}

/* Header & Navigation — compact, façon grande marque */
header {
    background: var(--white);
    padding: 0.45rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}
header .container { min-height: 64px; }
.logo { display: flex; align-items: center; gap: 0.6rem; }
.logo a { display: inline-flex; }
.logo img { height: 58px; width: auto; display: block; }
/* Nom de la marque à côté du logo — affiché quand la navigation passe en menu. */
.logo-name {
    display: none;
    font-weight: 800;
    line-height: 1.1;
    color: var(--primary);
    letter-spacing: -0.01em;
    font-size: 0.95rem;
    /* Deux lignes propres : « Elohim Home » / « School » */
    max-width: 8.5ch;
    white-space: normal;
}
@media (max-width: 992px) {
    header .flex-between { flex-wrap: nowrap; }
    .logo { min-width: 0; flex-shrink: 0; }
    .logo-name { display: block; }
}
@media (max-width: 480px) {
    .logo img { height: 46px; }
    .logo { gap: 0.45rem; }
    .logo-name { font-size: 0.82rem; }
}
@media (max-width: 360px) {
    .logo img { height: 40px; }
    .logo-name { font-size: 0.76rem; }
}
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a { text-decoration: none; color: var(--primary); font-weight: 700; font-size: 0.95rem; }

/* Lien « Connexion » de l'en-tête : pilule outline sobre, sur toutes les pages */
.header-actions { display: flex; align-items: center; gap: 0.75rem; }
.header-actions .btn-ghost,
.header-actions a[onclick*="toggleLoginModal"],
.header-actions a[href*="login"] {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    border: none;
    background: var(--secondary);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    line-height: 1;
    box-shadow: 0 6px 16px -4px rgba(255, 102, 0, 0.45);
    transition: transform 0.2s var(--ease-out), background 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.header-actions .btn-ghost:hover,
.header-actions a[onclick*="toggleLoginModal"]:hover,
.header-actions a[href*="login"]:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -6px rgba(255, 102, 0, 0.5);
}
/* Sur mobile, le bouton Connexion reste visible à côté du menu */
@media (max-width: 992px) {
    .header-actions a[onclick*="toggleLoginModal"],
    .header-actions a[href*="login"] {
        display: inline-flex !important;
        padding: 0.5rem 1rem;
        font-size: 0.82rem;
    }
    .mobile-only-nav { display: none !important; }
}
@media (max-width: 400px) {
    .header-actions a[onclick*="toggleLoginModal"],
    .header-actions a[href*="login"] { padding: 0.45rem 0.8rem; font-size: 0.78rem; }
    .header-actions { gap: 0.4rem; }
}
.nav-links.active {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background: white;
    padding: 80px 30px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    z-index: 1001;
    gap: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

#menuToggle {
    display: none;
    /* Cible tactile confortable, même si l'icône ne se charge pas. */
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    z-index: 1002;
    padding: 0;
}
#menuToggle svg { width: 26px; height: 26px; display: block; }

@media (max-width: 992px) {
    .nav-links { display: none; }
    .auth-btns, .header-actions { display: flex; align-items: center; gap: 0.5rem; }
    .auth-btns > a:not(#menuToggle), .header-actions > a:not(#menuToggle) { display: none; }
    #menuToggle { display: flex; }
    /* Connexion est déjà un bouton visible dans l'en-tête : pas de doublon
       dans le tiroir de navigation mobile. */
    .mobile-only-nav { display: none !important; }
}
.mobile-only-nav { display: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
    text-align: center;
}
.btn-primary { background: var(--secondary); color: var(--white); }
.btn-primary:hover { background: var(--secondary-hover); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-white { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

@media (max-width: 600px) { .btn { width: 100%; } }

/* Global Layout Spacing */
.py-luxury { padding-top: 100px; padding-bottom: 100px; }
.my-luxury { margin-top: 100px; margin-bottom: 100px; }

/* Hero Sections */
.hero, .hero-marketplace, .hero-signup, .page-header-teacher {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%), url('../img/hero-bg.png');
    background-size: cover;
    padding: 100px 0; /* Exact 100 requested */
    color: var(--white);
    text-align: center;
}
.hero h1, .hero-marketplace h1 { color: white; font-size: 3.5rem; margin-bottom: 1.5rem; }
@media (max-width: 768px) { h1 { font-size: 2.25rem !important; } }

/* Forms & Grids */
.form-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 1.5rem; 
    width: 100%; 
}
.form-full { grid-column: 1 / -1; }
.form-group { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.5rem; width: 100%; }
.form-group label { font-weight: 700; color: var(--primary); font-size: 0.9rem; text-align: left; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--gray-medium);
    background: #fff;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
}

/* Premium Components */
.filter-card, .cv-editor, .form-premium, .benefit-card-premium, .teacher-card-premium {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-medium);
}
@media (max-width: 600px) { 
    .filter-card, .cv-editor, .form-premium, .benefit-card-premium { padding: 1.5rem; }
}

.why-grid, .proof-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 2.5rem; 
}

/* CV Generator Specific */
.cv-generator-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 3rem; 
}
.cv-preview-box { 
    background: white; 
    padding: 3rem; 
    border-radius: 12px; 
    box-shadow: var(--shadow-lg); 
    border: 1px solid var(--gray-medium);
    overflow-x: auto;
}
@media (max-width: 600px) { 
    .cv-preview-box { padding: 1.5rem; }
    .cv-header-preview { flex-direction: column; align-items: center; text-align: center; }
}

/* Timeline */
.timeline-premium { position: relative; margin: 4rem 0; }
.timeline-item { padding: 1.5rem; border-left: 3px solid var(--secondary); margin-left: 1rem; margin-bottom: 2rem; position: relative; }

/* Utilities */
.reveal { opacity: 1; transform: translateY(0); transition: 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.ready { opacity: 0; transform: translateY(30px); }
.reveal.ready.active { opacity: 1; transform: translateY(0); }
.whatsapp-float { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    width: 65px; 
    height: 65px; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3); 
    z-index: 9999; 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: whatsapp-pulse 2.5s infinite;
}
.whatsapp-float:hover { 
    transform: scale(1.15) rotate(8deg); 
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.5);
}
@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* Marketplace Adjustments */
.page-layout { display: grid; grid-template-columns: 340px 1fr; gap: 4rem; }
@media (max-width: 992px) { 
    .page-layout { grid-template-columns: 1fr; }
    .page-layout aside { order: -1; }
}
/* Login Modal */
.login-modal { 
    display: none; 
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.85); 
    backdrop-filter: blur(12px); 
    z-index: 9000; 
    align-items: center; 
    justify-content: center; 
    padding: 20px; 
}
.login-modal.active { display: flex; animation: fadeIn 0.3s forwards; }
.login-box {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    /* Carte pleine et lisible (le verre translucide se voyait à peine). */
    background: linear-gradient(180deg, #0b1e45 0%, #071634 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    padding: 30px 30px 34px;
    position: relative;
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.6);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-box::-webkit-scrollbar { width: 8px; }
.login-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 8px; }
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-close { 
    position: absolute; 
    top: 24px; 
    right: 24px; 
    background: rgba(255,255,255,0.05); 
    border: 1px solid rgba(255,255,255,0.1); 
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: rgba(255,255,255,0.5); transition: all 0.3s; 
}
.login-close:hover { background: rgba(255,255,255,0.1); color: white; transform: rotate(90deg); }
.login-box h2 { color: white; font-size: 1.5rem; font-weight: 800; margin-bottom: 0.3rem; text-align: center; letter-spacing: -0.5px; }
.login-box p { color: rgba(255,255,255,0.5); text-align: center; margin-bottom: 1.3rem; font-size: 0.85rem; }
.login-form .ie-field-group { margin-bottom: 0.85rem; text-align: left; }
.login-form label { display: block; font-weight: 600; color: rgba(255,255,255,0.7); margin-bottom: 0.4rem; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; }
.login-form input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    font-size: 0.95rem;
    color: white;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.login-form .ie-input-wrap { position: relative; }
.login-form .ie-input-wrap input { padding-right: 44px; }
.login-form input:focus { border-color: #FF6600; background: rgba(255,255,255,0.09); outline: none; box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.3); }
.login-submit {
    width: 100%;
    padding: 14px;
    background: #FF6600;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    margin-top: 0.9rem;
    font-size: 1rem;
}
.login-submit:hover { transform: translateY(-2px); background: #E65C00; }
.login-footer { margin-top: 1.4rem; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.45); line-height: 1.6; }

/* Priorité sur les styles de formulaire des pages (labels navy invisibles
   sur le fond sombre de la modale, champ mot de passe blanchi par l'autofill). */
.login-modal .login-form label,
.login-box .ie-field-group label {
    color: rgba(255,255,255,0.75) !important;
    font-weight: 600 !important;
    font-size: 0.72rem !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    text-align: left !important;
}
.login-modal .login-form input,
.login-box .ie-field-group input {
    background: rgba(255,255,255,0.06) !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    color: #fff !important;
    border-radius: 12px !important;
}
.login-modal .login-form input::placeholder { color: rgba(255,255,255,0.35) !important; }
.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus,
.login-box input:-webkit-autofill:active,
.login-box input:autofill {
    -webkit-box-shadow: 0 0 0 1000px #0c1f47 inset !important;
    box-shadow: 0 0 0 1000px #0c1f47 inset !important;
    -webkit-text-fill-color: #fff !important;
    caret-color: #fff;
    transition: background-color 600000s 0s, color 600000s 0s;
}
.login-box .pass-toggle { color: rgba(255,255,255,0.55); }
.login-box .pass-toggle:hover { color: #fff; }
.login-forgot {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    margin: 0.1rem 0 0.2rem;
    cursor: pointer;
}
.login-forgot:hover { color: #FF6600; }
.login-footer a { color: white; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 2px; }
.login-footer a:hover { color: #FF6600; border-color: #FF6600; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Password Toggle */
.ie-input-wrap { position: relative; }
.pass-toggle { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #94a3b8; padding: 5px; display: flex; align-items: center; transition: color 0.3s; }
.pass-toggle:hover { color: #002366; }

/* ── FOOTER PREMIUM (Global) ── */
.footer-premium { background: #0F172A; padding: 4rem 0 0; color: rgba(255,255,255,0.7); border-top: 1px solid rgba(255,255,255,0.05); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand p { font-size: 0.88rem; line-height: 1.7; max-width: 280px; margin-bottom: 0.5rem; color: rgba(255,255,255,0.7) !important; }
.footer-quote { font-style: italic; font-size: 0.78rem !important; color: rgba(255,255,255,0.4) !important; margin-top: 0.75rem; }
.footer-socials { display: flex; gap: 0.75rem; margin-top: 1.25rem; }
.social-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,0.6); text-decoration: none; transition: all 0.2s; }
.social-icon:hover { background: #FF6600; border-color: #FF6600; color: white; }
.footer-col h4 { color: white; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1.25rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; padding: 0; }
.footer-col ul li { font-size: 0.88rem; display: flex; align-items: center; gap: 0.4rem; color: rgba(255,255,255,0.6); }
.footer-col ul li a { color: rgba(255,255,255,0.6); text-decoration: none; transition: color 0.2s; }
.footer-col ul li a:hover { color: #FF6600; }
.footer-bottom-bar { border-top: 1px solid rgba(255,255,255,0.08); padding: 1.5rem 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 1100px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
    .footer-bottom-bar { flex-direction: column; text-align: center; gap: 1rem; }
}

/* =============================================================================
   RENFORCEMENT MOBILE — aucune information coupée, aucun défilement horizontal
   ========================================================================== */
@media (max-width: 820px) {
    /* Toute grille de mise en page passe en une seule colonne qui peut rétrécir */
    .hero-grid, .hero-inscription-inner, .ie-hero-inner, .ie-hero-inner-v2,
    .signup-wrapper, .cv-generator-layout, .cv-generator-container,
    .marketplace-layout, .ie-form-container, .page-layout, .contact-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 1.5rem !important;
    }
    /* Un enfant de grille/flex ne doit jamais imposer sa largeur mini */
    main [class*="grid"] > *, main [class*="wrapper"] > *,
    main [class*="layout"] > *, main form > *, main .container > * { min-width: 0; }
    /* Le texte des boutons passe à la ligne plutôt que d'être coupé */
    button, .btn, a[class*="-btn"], [class*="submit-btn"] { white-space: normal; }
    /* Cases à cocher de consentement : le libellé s'enroule proprement */
    .sf-consent .consent-label, .ie-consent label, label.consent-label {
        display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem;
    }
}
@media (max-width: 560px) {
    /* Titres : un mot trop long se coupe au lieu de déborder */
    h1, h2, .hero-h1, .hero-title, .ie-highlight, .orange-text, .hero-highlight,
    .hero-insc-left h1, .ie-hero-left h1 {
        overflow-wrap: break-word;
        word-break: break-word;
    }
    /* Grilles de statistiques : une colonne, rien de rogné */
    .home-stats-grid, .why-us-grid, .why-grid, .proof-grid,
    .hcard-stats, .benefits-grid, .commit-grid, .ie-matieres-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    .stats-bar { flex-direction: column; align-items: stretch; }
    .stat-item { width: 100%; padding: 0.75rem 0 !important; min-width: 0 !important; }
    /* Grands chiffres fantômes des étapes : ne débordent plus de leur carte */
    .step-card, .how-step, [class*="step-card"] { overflow: hidden; }
}
