/* =====================================================
   AGITA Hero Section — Frontend CSS v2.0
   Mode : image background complet, texte à gauche
===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ─── Variables ────────────────────────────────── */
.ha-hero {
    --ha-bg:     #EEF4FB;
    --ha-title:  #0F4EA3;
    --ha-accent: #FF8A00;
    --ha-dark:   #0A3570;
    --ha-white:  #FFFFFF;
    --ha-text:   #1E293B;
    --ha-font:   'Poppins', sans-serif;
    --ha-trans:  .3s cubic-bezier(.4,0,.2,1);
}

/* ─── Reset ─────────────────────────────────────── */
.ha-hero *, .ha-hero *::before, .ha-hero *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ─── Section wrapper ───────────────────────────── */
.ha-hero {
    position: relative;
    width: 100%;
    min-height: 560px;
    background-color: var(--ha-bg);
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    font-family: var(--ha-font);
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 80px 0 70px;
}

/* ─── Overlay gradient ──────────────────────────── */
/* Quand image bg : gradient gauche opaque → droite transparent */
.ha-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    /* Couvre bien le côté texte, laisse voir l'image à droite */
    background: linear-gradient(
        to right,
        rgba(238, 244, 251, 0.97) 0%,
        rgba(238, 244, 251, 0.90) 35%,
        rgba(238, 244, 251, 0.60) 55%,
        rgba(238, 244, 251, 0.10) 75%,
        rgba(238, 244, 251, 0.00) 100%
    );
    pointer-events: none;
}

/* Overlay adaptatif selon couleur de fond choisie par l'admin */
/* Utilise la variable --ha-bg pour correspondre exactement */
.ha-overlay {
    background: linear-gradient(
        to right,
        var(--ha-bg) 0%,
        color-mix(in srgb, var(--ha-bg) 90%, transparent) 35%,
        color-mix(in srgb, var(--ha-bg) 55%, transparent) 55%,
        color-mix(in srgb, var(--ha-bg) 10%, transparent) 75%,
        transparent 100%
    );
}

/* Fallback browsers sans color-mix */
@supports not (color: color-mix(in srgb, red, blue)) {
    .ha-overlay {
        background: linear-gradient(
            to right,
            rgba(238,244,251,.97) 0%,
            rgba(238,244,251,.90) 35%,
            rgba(238,244,251,.55) 55%,
            rgba(238,244,251,.08) 75%,
            transparent 100%
        );
    }
}

/* ─── Blobs (mode sans image) ───────────────────── */
.ha-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}
.ha-blob-1 {
    width: 500px; height: 500px;
    background: rgba(15,78,163,.10);
    top: -150px; right: -80px;
}
.ha-blob-2 {
    width: 350px; height: 350px;
    background: rgba(255,138,0,.07);
    bottom: -100px; left: 5%;
}

/* ─── Inner container ───────────────────────────── */
.ha-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ─── Content block (gauche, max 55%) ───────────── */
.ha-hero-content {
    max-width: 580px;
    width: 100%;
}

/* ─── Title ─────────────────────────────────────── */
.ha-title {
    font-size: clamp(2.2rem, 4.5vw, 3.8rem);
    font-weight: 900;
    line-height: 1.08;
    color: var(--ha-title);
    margin-bottom: 18px;
    letter-spacing: -1.5px;
    text-transform: uppercase;
}

.ha-title-accent {
    color: var(--ha-accent);
}

/* Quand image bg → titre en bleu foncé reste lisible */
.ha-hero--has-bg .ha-title {
    color: var(--ha-dark);
    text-shadow: 0 1px 0 rgba(255,255,255,.4);
}

/* ─── Description ───────────────────────────────── */
.ha-description {
    font-size: clamp(.95rem, 1.8vw, 1.1rem);
    color: #334155;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 460px;
}

.ha-hero--has-bg .ha-description {
    color: #1E293B;
    font-weight: 500;
}

/* ─── Buttons ───────────────────────────────────── */
.ha-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 32px;
}

.ha-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 15px 34px;
    border-radius: 50px;
    font-family: var(--ha-font);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .2px;
    transition: var(--ha-trans);
    white-space: nowrap;
    cursor: pointer;
}

.ha-btn-primary {
    background: var(--ha-dark);
    color: var(--ha-white);
    box-shadow: 0 8px 28px rgba(10,53,112,.35);
}
.ha-btn-primary:hover {
    background: #062a5a;
    color: var(--ha-white);
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(10,53,112,.45);
}

.ha-btn-secondary {
    background: var(--ha-accent);
    color: var(--ha-white);
    box-shadow: 0 8px 28px rgba(255,138,0,.35);
}
.ha-btn-secondary:hover {
    background: #e07800;
    color: var(--ha-white);
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(255,138,0,.45);
}

/* ─── Social proof ──────────────────────────────── */
.ha-social-proof {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}

.ha-avatars {
    display: flex;
    align-items: center;
}
.ha-avatars img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--ha-white);
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    margin-left: -10px;
}
.ha-avatars img:first-child { margin-left: 0; }

.ha-social-text {
    font-size: .85rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.4;
}
.ha-hero--has-bg .ha-social-text {
    color: #1E293B;
}

/* ─── Trust pills ───────────────────────────────── */
.ha-trust-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ha-trust-item {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255,255,255,.92);
    border-radius: 50px;
    padding: 7px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,.08);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.ha-trust-icon {
    font-size: 1rem;
    line-height: 1;
}
.ha-trust-text {
    font-size: .8rem;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
}

/* ─── Responsive ────────────────────────────────── */

/* Tablette */
@media (max-width: 900px) {
    .ha-hero {
        background-position: center center;
        min-height: 480px;
        padding: 60px 0 50px;
    }
    .ha-hero-inner { padding: 0 24px; }
    .ha-hero-content { max-width: 100%; }

    /* Sur tablette, overlay couvre plus pour lisibilité */
    .ha-overlay {
        background: linear-gradient(
            to bottom,
            rgba(238,244,251,.92) 0%,
            rgba(238,244,251,.85) 60%,
            rgba(238,244,251,.70) 100%
        ) !important;
    }
}

/* Mobile */
@media (max-width: 640px) {
    .ha-hero {
        min-height: auto;
        padding: 50px 0 44px;
        /* Sur mobile, l'image de fond reste mais avec overlay fort */
        background-position: 70% center;
    }
    .ha-hero-inner { padding: 0 18px; }
    .ha-title { font-size: 2rem; letter-spacing: -1px; }
    .ha-description { font-size: .92rem; margin-bottom: 24px; }

    .ha-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 24px;
    }
    .ha-btn { width: 100%; max-width: 320px; justify-content: center; }

    .ha-trust-bar { gap: 8px; }
    .ha-trust-item { padding: 6px 12px; }
    .ha-trust-text { font-size: .75rem; }

    /* Overlay mobile opaque = texte toujours lisible */
    .ha-overlay {
        background: rgba(238,244,251,.88) !important;
    }
}

@media (max-width: 400px) {
    .ha-title { font-size: 1.75rem; }
    .ha-trust-bar { flex-direction: column; align-items: flex-start; }
}
