/* Inauguration du centre de tri VALOI — formulaire d'inscription (maquette Figma 1440 × 974) */

/* DIN Condensed vient du kit Adobe Fonts (famille "din-condensed", graisse unique 400).
   D-DIN Condensed (OFL, auto-hébergée) ne sert que de secours si le kit ne charge pas.
   Barlow (OFL) remplace DIN Next LT Pro, non licenciée pour le web ici. */
@font-face {
    font-family: "D-DIN Condensed";
    src: url("../fonts/d-din-condensed-bold.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-latin-400-italic.woff2") format("woff2");
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: "Barlow";
    src: url("../fonts/barlow-latin-300-italic.woff2") format("woff2");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

:root {
    --navy: #1a1d56;
    --green: #a2c516;
    --white: #fff;
    --field: #f5f5f5;
    --muted: rgba(26, 29, 86, 0.6);
    --error: #c4221f;

    --font-title: "din-condensed", "D-DIN Condensed", "DIN Condensed", "Arial Narrow", sans-serif;
    --font-text: "Barlow", "Helvetica Neue", Arial, sans-serif;

    --gutter: clamp(20px, 8.333vw, 120px);
    --card-width: 586px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #141414;
    color: var(--navy);
    font-family: var(--font-text);
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
p {
    margin: 0;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* ---------- Fond photo (déjà assombri dans le fichier source) ---------- */

.background {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #141414;
    background-image: url("../images/centre-de-tri-valoi-1200.jpg");
    background-image: image-set(
        url("../images/centre-de-tri-valoi-1200.webp") type("image/webp"),
        url("../images/centre-de-tri-valoi-1200.jpg") type("image/jpeg")
    );
    background-size: cover;
    background-position: 30% 50%;
}

@media (min-width: 1024px) {
    .background {
        background-image: url("../images/centre-de-tri-valoi.jpg");
        background-image: image-set(
            url("../images/centre-de-tri-valoi.webp") type("image/webp"),
            url("../images/centre-de-tri-valoi.jpg") type("image/jpeg")
        );
        /* Cadrage de la maquette : photo 1521 × 1013 posée en (-73, -19) sur 1440 × 974. */
        inset: -1.95% -0.56% -2.05% -5.07%;
        background-position: center;
    }
}

/* ---------- Mise en page ---------- */

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "hero"
        "card"
        "partners";
    row-gap: 32px;
    align-content: start;
    max-width: 1440px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 32px var(--gutter) 40px;
}

@media (min-width: 1024px) {
    .layout {
        grid-template-columns: minmax(0, 1fr) var(--card-width);
        /* La carte couvre les deux rangées : logos partenaires calés sur son bas. */
        grid-template-rows: auto auto;
        grid-template-areas:
            "hero card"
            "partners card";
        column-gap: 23px;
        row-gap: 40px;
        align-content: center;
        /* Maquette : marge droite de 122px pour 120px à gauche. */
        padding-block: 72px;
        padding-right: calc(var(--gutter) + 2px);
    }
}

/* ---------- Colonne de gauche ---------- */

.hero {
    grid-area: hero;
    container-type: inline-size;
    color: var(--white);
}

.hero__logo {
    width: 204px;
    height: 45px;
}

.hero__title {
    margin-top: 40px;
    font-family: var(--font-title);
    font-weight: 400;
    font-synthesis: none;
    /* 80px pour une colonne de 589px (maquette) : le titre tient toujours sur deux lignes. */
    font-size: clamp(40px, 13.58cqi, 80px);
    line-height: 1;
}

.hero__date {
    margin-top: 19px;
    color: var(--green);
    font-family: var(--font-title);
    font-weight: 400;
    font-synthesis: none;
    font-size: clamp(28px, 6.8cqi, 40px);
    line-height: 1;
}

.hero__intro {
    max-width: 432px;
    margin-top: 19px;
    font-size: 18px;
    line-height: 1.2;
}

@media (min-width: 1024px) {
    .hero__title {
        margin-top: 57px;
    }
}

.partners {
    grid-area: partners;
    align-self: end;
}

.partners__logos {
    width: 385px;
    height: auto;
    aspect-ratio: 385 / 82;
    border-radius: 20px;
    object-fit: cover;
    object-position: 49% 50%;
}

/* ---------- Carte blanche ---------- */

.card {
    grid-area: card;
    display: flex;
    flex-direction: column;
    padding: 40px 24px;
    border-radius: 20px;
    background: var(--white);
}

@media (min-width: 1024px) {
    .card {
        min-height: 830px;
        padding: 78px 76px 64px 78px;
    }
}

/* ---------- Formulaire ---------- */

.form__alert {
    margin-bottom: 24px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(196, 34, 31, 0.08);
    color: var(--error);
    font-size: 16px;
    line-height: 1.3;
}

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

.field {
    grid-column: 1 / -1;
}

.field--half {
    grid-column: span 1;
}

@media (max-width: 399px) {
    .field--half {
        grid-column: 1 / -1;
    }
}

.field__label {
    display: block;
    margin-bottom: 11px;
    font-size: 18px;
    line-height: 1;
}

.field__input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 0 20px;
    border: 0;
    border-radius: 20px;
    background: var(--field);
    color: var(--navy);
    font: inherit;
    font-size: 18px;
    line-height: 40px;
    appearance: none;
}

.field__input:focus {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.field__input[aria-invalid="true"] {
    box-shadow: inset 0 0 0 2px var(--error);
}

.field__error {
    margin-top: 6px;
    padding-left: 20px;
    color: var(--error);
    font-size: 14px;
    line-height: 1.2;
}

/* Case à cocher personnalisée : carré gris 24px, coche bleu marine. */
.checkbox {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 23px;
}

.checkbox__input {
    flex: none;
    width: 24px;
    height: 24px;
    margin: 0;
    border-radius: 4px;
    background: var(--field) no-repeat center / 14px 11px;
    cursor: pointer;
    appearance: none;
}

.checkbox__input:checked {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 11'%3E%3Cpath d='M1.5 5.5l4 4 7-8' fill='none' stroke='%231a1d56' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.checkbox__input:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

.checkbox__label {
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 139px;
    height: 45px;
    margin-top: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 30px;
    background: var(--navy);
    color: var(--white);
    font: inherit;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    /* Maquette (composant CTA) : survol en « Smart animate », ease-out 100 ms. */
    transition: background-color 0.1s ease-out;
}

.button:hover:not(:disabled) {
    background: var(--green);
}

.button:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
}

.button:disabled {
    opacity: 0.7;
    cursor: progress;
}

/* ---------- Mentions ---------- */

.legal {
    margin-top: 32px;
    color: var(--muted);
    font-size: 14px;
    font-style: italic;
    font-weight: 300;
    line-height: 1;
}

.legal p + p {
    margin-top: 14px;
}

/* ---------- Confirmation ---------- */

.confirmation {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.confirmation__icon {
    color: var(--green);
}

.confirmation__title {
    margin-top: 24px;
    font-family: var(--font-title);
    font-weight: 400;
    font-synthesis: none;
    font-size: 40px;
    line-height: 1;
}

.confirmation__text {
    margin-top: 16px;
    font-size: 18px;
    line-height: 1.3;
}

.confirmation__again {
    margin-top: 32px;
    font-size: 16px;
}
