/* Parcours d'inscription : newUtilisateur.php (étapes 1 à 3) et confirmationInscription.php (étape 4). */

body.pi-page {
    background: radial-gradient(circle at 10% 0%, #DDE6F2 0, transparent 45%),
                radial-gradient(circle at 95% 90%, #FFF1D0 0, transparent 40%),
                var(--pt-bg);
    min-height: 100vh;
    color: var(--pt-text);
}
body.dark.pi-page { background: var(--pt-bg); }

.pi { padding: 96px 16px 48px; min-height: 100vh; }
.pi-masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boîte à deux colonnes ---------- */
.pi-boite {
    max-width: 960px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    background: var(--pt-surface);
    border-radius: 22px;
    box-shadow: 0 18px 50px rgba(16, 24, 40, .14);
    overflow: hidden;
}
.pi-cote {
    background: linear-gradient(160deg, #2B4C7E 0%, #2F5285 60%, #1C355C 100%);
    color: #fff;
    padding: 40px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.pi-cote img { width: 100%; max-width: 230px; height: auto; margin: 0 auto 22px; display: block; }
.pi-cote h2 { font-size: 1.1rem; font-weight: 600; margin: 0 0 14px; color: #fff; }
.pi-cote ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pi-cote li { display: flex; align-items: center; gap: 12px; font-size: .97rem; }
.pi-cote li i {
    flex: none; width: 34px; height: 34px; border-radius: 10px;
    display: grid; place-items: center; font-size: 1.15rem;
    background: rgba(255, 255, 255, .16); color: #FFD66B;
}

.pi-principal { padding: 34px 40px 30px; }
.pi-principal h1, .pi-bienvenue h1 { font-size: 1.6rem; font-weight: 700; margin: 0 0 .35rem; color: var(--pt-text); }
.pi-sous-titre { color: var(--pt-muted); margin: 0 0 1.3rem; }
.pi-sous-titre strong { color: var(--pt-text); overflow-wrap: anywhere; }
.pi-ok { color: var(--pt-success); vertical-align: -2px; }
.pi-form .pt-btn { width: 100%; justify-content: center; padding-top: .8rem; padding-bottom: .8rem; font-size: 1.02rem; }
.pi-form .pt-field small, .pi-classes small { display: block; color: var(--pt-muted); font-size: .84rem; margin-top: .35rem; }
.pi-bas { margin: 1.2rem 0 0; text-align: center; color: var(--pt-muted); font-size: .95rem; }
.pi-bas a { color: var(--pt-primary); font-weight: 600; text-decoration: none; }
.pi-bas a:hover { text-decoration: underline; }
.pi-facultatif { font-weight: 400; color: var(--pt-muted); }
.pi-alert--info { background: var(--pt-primary-soft); color: var(--pt-text); border: 1px solid transparent; }
.pi-alert--info a, .pt-alert a { color: var(--pt-primary); font-weight: 600; }
.pt-alert ul { margin: .35rem 0 0; padding-left: 1.1rem; }

/* ---------- Barre d'étapes ---------- */
.pi-etapes { list-style: none; margin: 0 0 26px; padding: 0; display: flex; }
.pi-etape { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78rem; color: var(--pt-muted); text-align: center; }
.pi-etape::before {
    content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 3px;
    background: var(--pt-border); z-index: 0;
}
.pi-etape:first-child::before { display: none; }
.pi-etape--fait::before, .pi-etape--actuelle::before { background: var(--pt-primary); }
.pi-etape-puce {
    position: relative; z-index: 1;
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; font-weight: 700; font-size: .9rem;
    background: var(--pt-surface); border: 2px solid var(--pt-border); color: var(--pt-muted);
}
.pi-etape--fait .pi-etape-puce { background: var(--pt-primary); border-color: var(--pt-primary); color: #fff; font-size: 1.2rem; }
.pi-etape--actuelle .pi-etape-puce { border-color: var(--pt-primary); color: var(--pt-primary); box-shadow: 0 0 0 5px var(--pt-primary-soft); }
.pi-etape--actuelle { color: var(--pt-text); font-weight: 600; }

/* ---------- Étape 1 : élève ou parent ---------- */
.pi-choix { border: 0; margin: 0 0 1.1rem; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pi-choix legend, .pi-classes legend { font-weight: 600; font-size: .92rem; margin-bottom: .45rem; padding: 0; color: var(--pt-text); }
.pi-carte-choix { position: relative; cursor: pointer; display: block; }
.pi-carte-choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pi-carte-choix-corps {
    display: flex; flex-direction: column; gap: 2px; height: 100%;
    padding: 14px 14px 12px; border: 2px solid var(--pt-border); border-radius: 14px;
    background: var(--pt-surface);
}
.pi-carte-choix-corps i { font-size: 1.7rem; color: var(--pt-primary); margin-bottom: 4px; }
.pi-carte-choix-corps strong { font-size: 1rem; color: var(--pt-text); }
.pi-carte-choix-corps small { color: var(--pt-muted); font-size: .82rem; line-height: 1.3; }
.pi-carte-choix-corps::after {
    content: "\2713"; position: absolute; top: 10px; right: 10px;
    width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
    font-size: .8rem; font-weight: 700; color: #fff; background: var(--pt-primary);
    transform: scale(0); transition: transform .15s ease;
}
.pi-carte-choix:hover .pi-carte-choix-corps { border-color: var(--pt-primary); }
.pi-carte-choix input:checked + .pi-carte-choix-corps { border-color: var(--pt-primary); background: var(--pt-primary-soft); }
.pi-carte-choix input:checked + .pi-carte-choix-corps::after { transform: scale(1); }
.pi-carte-choix input:focus-visible + .pi-carte-choix-corps { box-shadow: var(--pt-focus); }

/* ---------- Étape 2 : code ---------- */
.pi-icone-etape {
    width: 64px; height: 64px; border-radius: 18px; margin-bottom: 14px;
    display: grid; place-items: center; font-size: 2rem;
    background: #FFF4D6; color: #E0A21A;
}
body.dark .pi-icone-etape { background: var(--pt-warning-soft); color: #F5B727; }
.pi-code {
    width: 100%;
    padding: .7rem .5rem .7rem 1.1rem;
    margin-bottom: 1rem;
    font: 700 2rem/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    letter-spacing: .55em;
    text-align: center;
    border: 2px solid var(--pt-border);
    border-radius: 14px;
    background: var(--pt-surface-2);
    color: var(--pt-text);
}
.pi-code::placeholder { color: var(--pt-border); }
.pi-code:focus { outline: none; border-color: var(--pt-primary); box-shadow: var(--pt-focus); background: var(--pt-surface); }
.pi-aide { margin-top: 1.3rem; padding: 14px 16px; border-radius: 12px; background: var(--pt-surface-2); font-size: .92rem; color: var(--pt-muted); }
.pi-aide p { margin: 0 0 .5rem; }
.pi-aide i { vertical-align: -2px; color: var(--pt-primary); }
.pi-aide-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.pi-aide-actions form { margin: 0; }
.pi-aide-actions .pt-link { font-weight: 600; }
.pi-aide-actions .pt-link[disabled] { color: var(--pt-muted); cursor: default; text-decoration: none; }

/* ---------- Étape 3 : profil ---------- */
.pi-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pi-classes { border: 0; margin: 0 0 1rem; padding: 0; }
.pi-classes-liste { display: flex; flex-wrap: wrap; gap: 8px; }
.pi-classe { position: relative; cursor: pointer; }
.pi-classe input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pi-classe span {
    display: inline-block; min-width: 64px; text-align: center;
    padding: .5rem .85rem; border-radius: 999px;
    border: 2px solid var(--pt-border); background: var(--pt-surface);
    font-weight: 600; font-size: .92rem; color: var(--pt-text);
}
.pi-classe:hover span { border-color: var(--c); }
.pi-classe input:checked + span { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 4px 12px rgba(16, 24, 40, .15); }
.pi-classe input:focus-visible + span { box-shadow: var(--pt-focus); }

.pi-force { height: 6px; border-radius: 99px; background: var(--pt-border); margin: .55rem 0 .5rem; overflow: hidden; }
.pi-force span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s ease, background-color .2s ease; }
.pi-force[data-niveau="1"] span { width: 20%; background: #C62828; }
.pi-force[data-niveau="2"] span { width: 40%; background: #E46E17; }
.pi-force[data-niveau="3"] span { width: 60%; background: #F5B727; }
.pi-force[data-niveau="4"] span { width: 80%; background: #7CB342; }
.pi-force[data-niveau="5"] span { width: 100%; background: #1B7A3D; }
.pi-regles { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .82rem; color: var(--pt-muted); }
.pi-regles li::before { content: "\25CB"; margin-right: 5px; }
.pi-regles li.ok { color: var(--pt-success); }
.pi-regles li.ok::before { content: "\2713"; font-weight: 700; }

/* ---------- Étape 4 : bienvenue ---------- */
.pi-bienvenue {
    position: relative; overflow: hidden;
    max-width: 760px; margin: 0 auto; padding: 32px 32px 34px;
    text-align: center; background: var(--pt-surface);
    border-radius: 22px; box-shadow: 0 18px 50px rgba(16, 24, 40, .14);
}
.pi-bienvenue .pi-etapes { max-width: 520px; margin-left: auto; margin-right: auto; }
.pi-bienvenue-visuel { width: 190px; height: auto; margin: 0 auto 8px; display: block; }
.pi-bienvenue h1 { font-size: 1.9rem; }
.pi-bienvenue-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pi-bienvenue-actions .pt-btn { padding: .8rem 1.3rem; }

.pi-confettis span {
    position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; opacity: 0;
    animation: pi-tombe 2.6s ease-in 0.2s 2 forwards;
}
.pi-confettis span:nth-child(1) { left: 8%;  background: #3383FF; animation-delay: .1s; }
.pi-confettis span:nth-child(2) { left: 20%; background: #F5B727; animation-delay: .5s; }
.pi-confettis span:nth-child(3) { left: 33%; background: #0EA145; animation-delay: .2s; }
.pi-confettis span:nth-child(4) { left: 47%; background: #F0102E; animation-delay: .7s; }
.pi-confettis span:nth-child(5) { left: 60%; background: #AB05F9; animation-delay: .3s; }
.pi-confettis span:nth-child(6) { left: 72%; background: #E46E17; animation-delay: .6s; }
.pi-confettis span:nth-child(7) { left: 84%; background: #3383FF; animation-delay: .15s; }
.pi-confettis span:nth-child(8) { left: 93%; background: #0EA145; animation-delay: .45s; }
@keyframes pi-tombe {
    0%   { opacity: 1; transform: translateY(0) rotate(0); }
    100% { opacity: 0; transform: translateY(420px) rotate(540deg); }
}

.pi-suggestions { max-width: 960px; margin: 34px auto 0; }
.pi-suggestions h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 14px; color: var(--pt-text); }
.pi-cartes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.pi-conseils { max-width: 960px; margin: 30px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pi-conseils > div {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
    padding: 18px 16px; border-radius: 16px; background: var(--pt-surface); border: 1px solid var(--pt-border);
}
.pi-conseils img { width: 64px; height: auto; margin-bottom: 4px; }
.pi-conseils strong { color: var(--pt-text); }
.pi-conseils span { color: var(--pt-muted); font-size: .9rem; }
.pi-bas--centre { max-width: 960px; margin: 22px auto 0; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
    .pi { padding: 84px 12px 32px; }
    .pi-boite { grid-template-columns: 1fr; border-radius: 18px; }
    .pi-cote { display: none; }
    .pi-principal { padding: 24px 18px 22px; }
    .pi-cartes, .pi-conseils { grid-template-columns: 1fr; }
    .pi-bienvenue { padding: 24px 18px 26px; }
    .pi-bienvenue-actions .pt-btn { width: 100%; justify-content: center; }
}
@media (max-width: 420px) {
    .pi-etape-nom { font-size: .7rem; }
    .pi-deux { grid-template-columns: 1fr; gap: 0; }
    .pi-code { font-size: 1.6rem; letter-spacing: .45em; }
}
@media (prefers-reduced-motion: reduce) {
    .pi-confettis { display: none; }
}

/* ---------- Écran simple (mot de passe oublié) ---------- */
.pi-seul {
    max-width: 480px; margin: 0 auto; padding: 32px 34px 30px;
    background: var(--pt-surface); border-radius: 22px; box-shadow: 0 18px 50px rgba(16, 24, 40, .14);
}
.pi-seul .pi-etapes { margin-bottom: 22px; }
.pi-icone-etape--ok { background: var(--pt-success-soft); color: var(--pt-success); }
.pi-btn-large { width: 100%; justify-content: center; padding-top: .8rem; padding-bottom: .8rem; }
@media (max-width: 520px) { .pi-seul { padding: 24px 18px 22px; border-radius: 18px; } }

/* ---------- 04/11/2026 : série, bloc « Ton enfant », cases à cocher des conditions ---------- */
.pi-section { font-size: 1rem; font-weight: 700; color: var(--pt-text); margin: 1.4rem 0 .5rem; padding-top: 1rem; border-top: 1px solid var(--pt-border); }
.pi-form > .pi-section:first-of-type { margin-top: .2rem; padding-top: 0; border-top: 0; }
.pi-section-aide { margin: -.2rem 0 .9rem; color: var(--pt-muted); font-size: .88rem; line-height: 1.45; }
.pi-series { margin-top: -.3rem; }
.pi-series .pi-classe span { min-width: 52px; }
.pi-serie[hidden] { display: none; }
.pi-accords { border: 0; margin: 1.1rem 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.pi-case { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; line-height: 1.45; color: var(--pt-text); cursor: pointer; }
.pi-case input { flex: none; width: 18px; height: 18px; margin: .12rem 0 0; accent-color: var(--pt-primary); cursor: pointer; }
.pi-case a { color: var(--pt-primary); font-weight: 600; }
.pi-case--facultative { color: var(--pt-muted); }

/* Page « Complète ton profil » */
.pi-manques { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 12px; background: var(--pt-primary-soft); font-size: .9rem; }
.pi-estime { display: block; margin: .35rem 0 .9rem; color: var(--pt-muted); font-size: .84rem; }
.pi-plus-tard { display: block; text-align: center; margin-top: .9rem; color: var(--pt-muted); font-size: .92rem; }
