/* ==============================================
   TOKENS GLOBAUX
=============================================== */

:root {
    --bg: #ffffff;
    --fg: #111111;
    --muted: #666666;
    --border: #e5e5e5;
    --card: #ffffff;
    --secondary: #f3f3f3;
}


/* ==============================================
   SECTION HERO — #ai-signal
=============================================== */

#ai-signal {
    position: relative;
    z-index: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--fg);
    height: 85vh;
    display: flex;
    align-items: center;
}

#ai-signal .container-fluid,
#ai-signal .row,
#ai-signal .col-lg-12 {
    height: 100%;
}

/* Particles */
#particles-js {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Contenu hero */
#ai-signal .hero-text {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
}

.hero-text h1 {
    text-align: left;
}
.hero-text p {
    text-align: left !important;
}

.hero-label {
    width: 250px;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 25px;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--muted);
}

/* Formulaire hero */
.ai-signal-form {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: center;
    gap: 12px;
    max-width: 500px;
}

.ai-signal-form input {
    flex: 1;
    min-width: 250px;
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 14px;
    transition: all 0.2s ease;
}

.ai-signal-form input:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.ai-signal-meta {
    font-size: 12px !important;
    color: var(--muted) !important;
    text-align: center !important;
    width: 100%;
}

/* Responsive hero */
@media (max-width: 992px) {
    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 28px;
    }

    .ai-signal-form {
        flex-direction: column;
    }

    .ai-signal-form button {
        width: 100%;
    }
}


/* ==============================================
   ANIMATIONS HERO (fade-up, déclenché au load)
=============================================== */

.fade-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeUp 0.8s ease both;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==============================================
   SECTION DATAFLOW — #dataflow
=============================================== */

#dataflow {
    background-repeat: no-repeat;
    background-image: url(/img/background/research.jpg);
    background-size: cover;
    background-position: bottom;
    position: relative;
    z-index: 0;
}

#dataflow::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(25, 28, 33, 0.7);
    z-index: 1;
}

#dataflow.dataflow-section {
    padding: 96px 0;
    position: relative;
    overflow: hidden;
}

#dataflow .container {
    position: relative;
    z-index: 2;
}

/* En-tête */
#dataflow .dataflow-head {
    color: #fff;
    margin-bottom: 64px;
}

#dataflow .dataflow-kicker {
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

#dataflow .dataflow-title {
    color: #fff;
    font-size: 36px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

#dataflow .dataflow-subtitle {
    color: #fff;
    max-width: 560px;
    margin: 0 auto;
}

/* Grille */
#dataflow .dataflow-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
}

@media (min-width: 768px) {
    #dataflow .dataflow-grid {
        grid-template-columns: 1fr 60px 1fr 60px 1fr;
        gap: 0;
    }
}

#dataflow .dataflow-col {
    position: relative;
    z-index: 2;
}

#dataflow .dataflow-gap {
    height: 1px;
}

#dataflow .dataflow-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Cards sources */
#dataflow .source-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(3px);
    transition: border-color 0.2s ease;
}

#dataflow .source-ico {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.9);
}

#dataflow .source-ico svg {
    width: 20px;
    height: 20px;
}

#dataflow .source-sub {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #fff;
}

#dataflow .source-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Card centrale */
#dataflow .center-card {
    position: relative;
    padding: 32px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(3px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
    overflow: visible;
}

#dataflow .center-brand {
    width: 150px;
    margin: 0 auto 16px;
}

#dataflow .center-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    line-height: 1.5;
}

#dataflow .center-chips {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

#dataflow .chip {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.8);
}

/* Card droite */
#dataflow .output-card {
    padding: 24px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(3px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.20);
}

#dataflow .output-kicker {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
}

#dataflow .output-item {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 12px;
}

#dataflow .output-item-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
    color: #fff;
}

#dataflow .output-item-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

#dataflow .dataflow-lines {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

#dataflow .line-base {
    position: absolute;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    transform-origin: left center;
}

#dataflow .line-glow-wrap {
    position: absolute;
    height: 3px;
    overflow: hidden;
    transform-origin: left center;
}

#dataflow .line-glow {
    position: absolute;
    top: 0;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    will-change: transform;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.35);
}

/* Border glow */

#dataflow .border-glow-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

#dataflow .border-glow-dot {
    position: absolute;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #fff, transparent);
    box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.4);
    offset-rotate: 0deg;
    opacity: 0;
}

/* ==============================================
   DELAYS HERO (au load)
=============================================== */

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.30s;
}

.delay-3 {
    animation-delay: 0.45s;
}

.delay-4 {
    animation-delay: 0.60s;
}

.delay-5 {
    animation-delay: 0.75s;
}


/* ==============================================
   ANIMATIONS DATAFLOW (scroll-triggered)

   .df-anim            → caché par défaut
   .df-fade-left/right/scale → direction de départ
   .df-delay-*         → délai d'animation
   #dataflow.animate   → déclenché par JS après preloader
   fill-mode: both     → reste à l'état FROM pendant le delay
=============================================== */

/* État initial : invisible + position de départ */
.df-anim.df-fade-left {
    opacity: 0;
    transform: translateX(-30px);
}

.df-anim.df-fade-right {
    opacity: 0;
    transform: translateX(30px);
}

.df-anim.df-fade-scale {
    opacity: 0;
    transform: scale(0.8);
}

/* Déclenché quand #dataflow reçoit .animate */
#dataflow.animate .df-fade-left {
    animation: dfFadeLeft 0.6s cubic-bezier(.22, .61, .36, 1) both;
}

#dataflow.animate .df-fade-right {
    animation: dfFadeRight 0.6s cubic-bezier(.22, .61, .36, 1) both;
}

#dataflow.animate .df-fade-scale {
    animation: dfFadeScale 0.7s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes dfFadeLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dfFadeRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes dfFadeScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Delays — échelonnés comme dans le React (i * 0.1) */
.df-delay-1 {
    animation-delay: 0.00s;
}

.df-delay-2 {
    animation-delay: 0.10s;
}

.df-delay-3 {
    animation-delay: 0.20s;
}

.df-delay-4 {
    animation-delay: 0.30s;
}

.df-delay-5 {
    animation-delay: 0.40s;
}


/* ==============================================
   SECTION CTA — #cta
=============================================== */

#cta.cta-section {
    padding: 96px 0;
}

#cta .cta-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 56px 48px;
    border-radius: 16px;
    background: var(--card);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    text-align: center;
}

#cta .cta-brand {
    width: 200px;
    margin: 0 auto 16px;
}

#cta .cta-divider {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

#cta .cta-kicker {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
    margin-bottom: 24px;
}

/* Ligne prénom / nom */
#cta .cta-name-row {
    display: flex;
    gap: 12px;
}

#cta .cta-name-row input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--secondary);
    font-size: 14px;
    transition: all 0.2s ease;
}

#cta .cta-name-row input:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
    #cta .cta-name-row {
        flex-direction: column;
    }
}

/* Formulaire CTA */
#cta .cta-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

#cta .cta-form input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--secondary);
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

#cta .cta-form input:focus {
    outline: none;
    border-color: var(--fg);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

#cta .cta-form button:disabled,
.ai-signal-form button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Message de confirmation */
#cta .cta-thanks {
    display: none;
    max-width: 400px;
    margin: 0 auto;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
}

/* Checkbox consent */
#cta .consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    cursor: pointer;
}

#cta .consent input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: var(--fg);
}

#cta .consent span {
    display: inline;
}

/* Lien politique de confidentialité */
#cta .consent a {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
    display: inline;
}

#cta .consent a:hover {
    color: var(--fg);
}

.hp-field {
    position: absolute;
    left: -9999px;
    height: 0;
    opacity: 0;
}

.cta-name-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.field-group {
    display: flex;
    flex-direction: column;
    align-items: start;
    width: 100%;
}

.form-error {
    font-size: 0.85rem;
    color: #ff4d4f;
    margin-top: 6px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.25s ease;
}

.form-error.active {
    margin-left: 10px;
    max-height: 40px;
    opacity: 1;
}

input.invalid {
    border-color: #ff4d4f;
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.15);
}
