/* ============================================================
   Accueil (body.page-home) : la Recherche intelligente comme point d'entrée
   Bandeau bleu marine pleine largeur, grand titre, carte de saisie blanche,
   parcours en cinq étapes comme un fil en bas du bandeau.
   Palette 100% IDT : marine, magenta, bleu ciel, rose clair.
   + lien de retour de la page « Explorer par source »
   ============================================================ */

.page-home {
    --home-max: 1120px;
    --home-navy: #193461;
    --home-navy-deep: #0d2342;
    --home-accent: #ac2777;
    --home-accent-dark: #8e1f62;
    --home-rose: #f2a7c9;
    --home-sky: #12b2de;
    --home-line: #e3e7ee;
    --home-text: #3b4350;
    --home-focus-dark: #f2a7c9;
}

.page-home .main-content {
    background: #f5f7fb;
    padding-bottom: 72px;
}

/* ---------------- Bandeau ---------------- */
.page-home .home-hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0 0;
    color: #fff;
    background:
        radial-gradient(900px 520px at 88% -12%, rgba(172, 39, 119, .5), transparent 62%),
        radial-gradient(760px 520px at -4% 108%, rgba(18, 178, 222, .32), transparent 60%),
        linear-gradient(160deg, var(--home-navy-deep) 0%, var(--home-navy) 55%, #1e3f73 100%);
}

/* Trame de points très discrète, qui s'efface vers le bas */
.page-home .home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
    background-size: 24px 24px;
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
    mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

.home-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.home-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font: 600 .78rem/1 var(--font-family, Inter, sans-serif);
    letter-spacing: .16em;
    text-transform: uppercase;
}

.home-kicker::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--home-rose);
}

.home-title {
    margin: 26px 0 22px;
    color: #fff;
    font: 800 clamp(2.4rem, 5.3vw, 4.4rem)/1.04 var(--font-family, Inter, sans-serif);
    letter-spacing: -.035em;
    text-wrap: balance;
}

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

.home-lead {
    max-width: 640px;
    margin: 0 auto 38px;
    color: rgba(255, 255, 255, .86);
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    line-height: 1.6;
}

/* ---------------- Carte de saisie ---------------- */
.home-ask {
    max-width: 780px;
    margin: 0 auto;
}

.home-ask-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 22px 16px 14px 24px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 28px 70px rgba(3, 10, 26, .5), 0 0 0 1px rgba(255, 255, 255, .08);
    text-align: left;
    transition: box-shadow .15s ease;
}

.home-ask-box:focus-within {
    box-shadow: 0 0 0 4px rgba(242, 167, 201, .6), 0 28px 70px rgba(3, 10, 26, .5);
}

.home-ask-box textarea {
    width: 100%;
    min-height: 82px;
    max-height: 70vh;
    padding: 0 8px 0 0;
    border: 0;
    outline: 0;
    resize: none;
    overflow-y: auto;
    background: transparent;
    color: #0f172a;
    font: 400 1.12rem/1.55 var(--font-family, Inter, sans-serif);
}

.home-ask-box textarea::placeholder {
    color: #5b6472;
    opacity: 1;
}

.home-ask-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
}

.home-ask-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    color: #4a5568;
    font-size: .86rem;
}

.home-ask-hint .material-icons {
    font-size: 16px;
}

.home-ask-voice,
.home-ask-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    font: 600 .98rem/1 var(--font-family, Inter, sans-serif);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease;
}

.home-ask-voice {
    border: 1px solid #cfd6e2;
    background: #fff;
    color: var(--home-navy);
}

.home-ask-voice:hover {
    background: #f3f5f9;
    border-color: var(--home-navy);
}

.home-ask-voice .material-icons {
    font-size: 20px;
    color: var(--home-accent);
}

.home-ask-submit {
    padding: 0 16px 0 22px;
    border: 0;
    background: var(--home-accent);
    color: #fff;
}

.home-ask-submit:hover:not(:disabled) {
    background: var(--home-accent-dark);
}

.home-ask-submit:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.home-ask-submit .material-icons {
    font-size: 20px;
}

.home-ask-voice:focus-visible,
.home-ask-submit:focus-visible {
    outline: 3px solid #0b6b8a;
    outline-offset: 2px;
}

/* ---------------- Exemples (sur fond sombre) ---------------- */
.home-examples {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 26px 0 0;
}

.home-examples-label {
    color: rgba(255, 255, 255, .78);
    font-size: .9rem;
}

.home-example {
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font: 500 .92rem/1.2 var(--font-family, Inter, sans-serif);
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.home-example:hover {
    background: rgba(255, 255, 255, .16);
    border-color: #fff;
}

.home-example:focus-visible {
    outline: 3px solid var(--home-focus-dark);
    outline-offset: 2px;
}

/* ---------------- Le fil : parcours en cinq étapes ---------------- */
.home-rail-wrap {
    position: relative;
    z-index: 1;
    margin-top: 72px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background: rgba(4, 14, 32, .32);
}

.home-rail-inner {
    max-width: var(--home-max);
    margin: 0 auto;
    padding: 30px 24px 38px;
}

.home-rail-title {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, .72);
    font: 600 .78rem/1 var(--font-family, Inter, sans-serif);
    letter-spacing: .16em;
    text-transform: uppercase;
}

.home-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-step {
    position: relative;
    padding-right: 22px;
}

.home-step-num {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1.5px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    color: #fff;
    font: 700 .95rem/1 var(--font-family, Inter, sans-serif);
}

/* La première étape est le point de départ : pleine, en rose */
.home-step:first-child .home-step-num {
    background: var(--home-rose);
    border-color: var(--home-rose);
    color: var(--home-navy-deep);
}

.home-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 48px;
    right: 12px;
    height: 1px;
    background: rgba(255, 255, 255, .26);
}

.home-step h3 {
    margin: 14px 0 6px;
    color: #fff;
    font: 600 1.02rem/1.3 var(--font-family, Inter, sans-serif);
}

.home-step p {
    margin: 0;
    color: rgba(255, 255, 255, .74);
    font-size: .88rem;
    line-height: 1.5;
}

/* ---------------- « Mes plans en cours » ---------------- */
.page-home .my-plans-wrap {
    max-width: var(--home-max);
    margin: 48px auto 0;
    padding: 0 24px;
}

.page-home .my-plans {
    padding: 26px 28px 28px;
    border: 1px solid var(--home-line);
    border-radius: 18px;
    box-shadow: 0 6px 24px rgba(25, 52, 97, .06);
}

.page-home .my-plans-card {
    background: #fff;
    border-color: var(--home-line);
}

.page-home .my-plans-card.is-highlight {
    background: #fff;
    border: 1px solid var(--home-line);
    border-left: 4px solid var(--home-accent);
}

.page-home .my-plans-card.is-highlight .my-plans-bilan,
.page-home .my-plans-card.has-form-open > .my-plans-bilan {
    border-color: var(--home-line);
}

@media (min-width: 981px) {
    /* Quand une carte de bilan occupe une ligne entière, les autres se partagent la suivante (pas de trou) */
    .page-home .my-plans-list:has(> .has-form-open) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Bilan compact : le commentaire et l'envoi n'apparaissent qu'une fois la réponse choisie */
.page-home .pb-panel:not(:has(input[type="radio"]:checked)) .pb-comment,
.page-home .pb-panel:not(:has(input[type="radio"]:checked)) .pb-btn-primary {
    display: none;
}

/* ---------------- Accès directs : Catalogue, Explorer par source ---------------- */
.home-browse {
    max-width: var(--home-max);
    margin: 56px auto 0;
    padding: 0 24px;
}

.home-browse-title {
    margin: 0 0 18px;
    color: var(--home-navy);
    font: 700 1.45rem/1.25 var(--font-family, Inter, sans-serif);
}

.home-browse-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.home-browse-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 26px 28px 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--home-line);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(25, 52, 97, .06);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.home-browse-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: var(--home-navy);
}

.home-browse-card.is-explorer::before {
    background: var(--home-accent);
}

.home-browse-card:hover {
    border-color: #c5cede;
    box-shadow: 0 14px 36px rgba(25, 52, 97, .12);
    transform: translateY(-2px);
}

.home-browse-card:focus-visible {
    outline: 3px solid #0b6b8a;
    outline-offset: 3px;
}

.home-browse-kicker {
    color: var(--home-accent);
    font: 700 .76rem/1 var(--font-family, Inter, sans-serif);
    letter-spacing: .14em;
    text-transform: uppercase;
}

.home-browse-card.is-catalogue .home-browse-kicker {
    color: var(--home-navy);
}

.home-browse-name {
    color: #0f172a;
    font: 700 1.2rem/1.3 var(--font-family, Inter, sans-serif);
}

.home-browse-text {
    color: var(--home-text);
    font-size: .95rem;
    line-height: 1.55;
}

.home-browse-go {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: var(--home-navy);
    font-weight: 600;
    font-size: .95rem;
}

.home-browse-go .material-icons {
    font-size: 19px;
    transition: transform .15s ease;
}

.home-browse-card:hover .home-browse-go .material-icons {
    transform: translateX(3px);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .home-steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .home-step {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: 14px;
        padding-right: 0;
    }

    .home-step:not(:last-child)::after {
        display: none;
    }

    .home-step-num {
        grid-row: 1 / span 2;
    }

    .home-step h3 {
        margin: 6px 0 2px;
    }

    .home-browse-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 720px) {
    .page-home .home-hero {
        padding-top: 48px;
    }

    .home-hero-inner,
    .home-rail-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-rail-wrap {
        margin-top: 48px;
    }

    .home-ask-box {
        padding: 18px 14px 14px 18px;
    }

    .home-ask-hint {
        flex-basis: 100%;
        margin-right: 0;
    }

    .page-home .my-plans-wrap,
    .home-browse {
        padding: 0 16px;
    }

    .page-home .my-plans-wrap {
        margin-top: 32px;
    }

    .page-home .my-plans {
        padding: 20px 16px;
    }
}

@media (max-width: 520px) {
    .home-ask-tools {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---------------- Page « Explorer par source » : lien de retour vers le Catalogue ---------------- */
.explorer-back {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    color: var(--primary-color, #193461);
    font-weight: 600;
    font-size: .95rem;
    text-decoration: none;
}

.explorer-back:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.explorer-back:focus-visible {
    outline: 3px solid #0b6b8a;
    outline-offset: 3px;
    border-radius: 4px;
}

.explorer-back .material-icons {
    font-size: 18px;
}

/* Liens dans le sous-titre du bandeau d'« Explorer par source » : couleur du site, soulignés */
.hero-subtitle a {
    color: var(--primary-color, #193461);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .home-ask-box,
    .home-ask-voice,
    .home-ask-submit,
    .home-example,
    .home-browse-card,
    .home-browse-go .material-icons {
        transition: none;
    }

    .home-browse-card:hover {
        transform: none;
    }
}
