/* =========================================================
   Page d'inscription
   Le thème suit le camp choisi : body[data-camp="defenseurs" | "attaquants"]
   ========================================================= */

body {
    min-height: 100vh;
    --accent-rvb: var(--texte-rvb);
    --accent: var(--texte);
    --accent-texte: var(--nuit);
}

body[data-camp="defenseurs"] {
    --accent-rvb: var(--def-rvb);
    --accent: var(--def);
    --accent-texte: var(--def-encre);
}

body[data-camp="attaquants"] {
    --accent-rvb: var(--att-rvb);
    --accent: var(--att);
    --accent-texte: #fff;
}

/* ---------- Fond qui change selon le camp ---------- */

.fond {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--nuit) url(../imgs/web/fond.webp) center / cover;
}

.fond::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(var(--nuit-rvb) / 0.82) 0%, rgb(var(--nuit-rvb) / 0.94) 60%, var(--nuit) 100%);
}

.fond__image {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.fond__image--def { background-image: url(../imgs/web/fond-defenseurs.webp); }
.fond__image--att { background-image: url(../imgs/web/fond-attaquants.webp); }

[data-camp="defenseurs"] .fond__image--def,
[data-camp="attaquants"] .fond__image--att {
    opacity: 1;
}

/* ---------- En-tête ---------- */

.entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}

.retour {
    color: var(--texte-2);
    font-weight: 500;
    text-decoration: none;
    padding: 10px 0;
}

.retour::before {
    content: "‹ ";
}

.retour:hover {
    color: var(--texte);
}

/* ---------- Titre de page ---------- */

.page {
    max-width: 980px;
    padding: clamp(24px, 5vw, 56px) 0 96px;
}

.page__titre {
    font-size: clamp(2.4rem, 6vw, 4rem);
    color: var(--accent);
    transition: color 0.4s ease;
}

.page__intro {
    margin-top: 12px;
    font-size: 1.2rem;
    color: var(--texte-2);
}

/* ---------- Étapes ---------- */

.etape {
    margin: 48px 0 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.etape__titre {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0;
    font-family: var(--titre);
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
}

.etape__num {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    background: var(--accent);
    color: var(--accent-texte);
    font-size: 1.1rem;
    --biseau: 8px;
    transition: background-color 0.4s ease;
}

.etape__aide {
    margin-top: 10px;
    color: var(--texte-2);
}

/* ---------- Choix du camp ---------- */

.camps {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.camp {
    --couleur: var(--def);
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 300px;
    overflow: hidden;
    cursor: pointer;
    background: var(--acier);
    --biseau: 22px;
    transition: filter 0.35s ease;
}

.camp--att {
    --couleur: var(--att);
}

.camp input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.camp img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    transition: transform 0.5s ease;
}

.camp::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgb(var(--nuit-rvb) / 0.95) 10%, rgb(var(--nuit-rvb) / 0.35) 70%);
}

/* Cadre de la couleur du camp, visible au survol et une fois choisi */
.camp::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    box-shadow: inset 0 0 0 2px rgb(var(--texte-rvb) / 0.18);
    transition: box-shadow 0.25s ease;
}

.camp:hover::after {
    box-shadow: inset 0 0 0 2px var(--couleur);
}

.camp:hover img {
    transform: scale(1.04);
}

.camp:has(input:checked)::after {
    box-shadow: inset 0 0 0 4px var(--couleur);
}

.camp:has(input:focus-visible)::after {
    box-shadow: inset 0 0 0 4px var(--or);
}

/* Le camp non choisi s'efface */
body:not([data-camp=""]) .camp:not(:has(input:checked)) {
    filter: grayscale(0.85) brightness(0.65);
}

.camp:not(:has(input:checked)):hover {
    filter: none;
}

.camp__texte {
    position: relative;
    z-index: 2;
    display: block;
    padding: 24px 24px 26px;
}

.camp__nom {
    display: block;
    font-family: var(--titre);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--couleur);
}

.camp__desc {
    display: block;
    margin-top: 8px;
    max-width: 38ch;
    font-size: 1.02rem;
    line-height: 1.45;
}

.camp__coche {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid rgb(var(--texte-rvb) / 0.7);
    background: rgb(var(--nuit-rvb) / 0.5);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.camp input:checked ~ .camp__coche {
    background: var(--couleur);
    border-color: var(--couleur);
}

.camp input:checked ~ .camp__coche::after {
    content: "";
    position: absolute;
    left: 10px;
    top: 5px;
    width: 9px;
    height: 16px;
    border: solid #fff;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

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

.etape--details {
    position: relative;
    margin-top: 56px;
    padding: clamp(24px, 4vw, 40px);
    background: rgb(var(--acier-rvb) / 0.88);
    backdrop-filter: blur(8px);
    --biseau: 24px;
    box-shadow: inset 0 3px 0 var(--accent);
    transition: box-shadow 0.4s ease;
}

.etape--details .etape__titre {
    float: left;
    width: 100%;
}

/* La légende flotte pour rester dans le cadre ; tout le reste passe dessous */
.etape--details > :not(legend) {
    clear: both;
}

.etape__verrou {
    display: none;
}

.etape--details:disabled .etape__verrou {
    display: block;
}

.etape--details:disabled .champs,
.etape--details:disabled .bouton--envoi {
    opacity: 0.4;
}

.champs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px 24px;
    margin-top: 24px;
}

.champ--large {
    grid-column: 1 / -1;
}

.champ label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.facultatif {
    font-weight: 400;
    color: var(--texte-2);
}

.champ input[type="text"],
.champ input[type="email"],
.champ input[type="tel"],
.champ input[type="password"] {
    width: 100%;
    min-height: 52px;
    padding: 12px 16px;
    border: 1px solid var(--ligne);
    border-radius: 0;
    background: rgb(var(--nuit-rvb) / 0.8);
    color: var(--texte);
    font: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.champ input::placeholder {
    color: var(--texte-3);
}

.champ input:hover {
    border-color: var(--ligne-forte);
}

.champ input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(var(--accent-rvb) / 0.12);
}

.champ input[aria-invalid="true"] {
    border-color: var(--erreur);
}

.champ__aide {
    margin-top: 6px;
    font-size: 0.95rem;
    color: var(--texte-2);
}

.champ__erreur {
    margin-top: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--erreur);
}

.champ__erreur:empty {
    display: none;
}

.mdp {
    position: relative;
}

/* Place pour le bouton « Afficher » (le champ passe de password à text) */
.champ .mdp input {
    padding-right: 104px;
}

.mdp__voir {
    position: absolute;
    top: 6px;
    right: 6px;
    bottom: 6px;
    padding: 0 14px;
    border: 0;
    background: var(--acier-2);
    color: var(--texte);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.mdp__voir:hover {
    background: var(--ligne);
}

.champ .case {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-weight: 400;
    cursor: pointer;
}

.case input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 2px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.case a {
    color: var(--accent);
}

.bouton--envoi {
    --fond-bouton: var(--accent);
    --texte-bouton: var(--accent-texte);
    margin-top: 32px;
    min-width: 280px;
    transition: background-color 0.4s ease, filter 0.2s ease;
}

.bouton--envoi:disabled {
    cursor: not-allowed;
}

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

.confirmation {
    margin-top: 48px;
    padding: clamp(28px, 5vw, 48px);
    background: rgb(var(--acier-rvb) / 0.92);
    --biseau: 24px;
    box-shadow: inset 0 3px 0 var(--accent);
    animation: apparition 0.4s ease both;
}

.confirmation:focus {
    outline: none;
}

.confirmation h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    color: var(--accent);
}

.confirmation p {
    margin-top: 14px;
    max-width: 60ch;
    font-size: 1.15rem;
}

.confirmation__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

@keyframes apparition {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* ---------- Écrans étroits ---------- */

@media (max-width: 720px) {
    .camps,
    .champs {
        grid-template-columns: 1fr;
    }

    .camp {
        min-height: 240px;
    }

    .camp__nom {
        font-size: 1.7rem;
    }

    .bouton--envoi,
    .confirmation__actions .bouton {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .retour {
        font-size: 0.95rem;
    }

    .marque span {
        display: none;
    }
}
