/* LOT 104 — LA PORTE UNIQUE. Charte : vert Sahel #2B6441, vert profond #1E4630,
   or #D3AF61, encre #141814, papier #FAF9F6. Téléphone d'abord (390 px). */
*, *::before, *::after { box-sizing: border-box; }
:root {
    --vert: #2B6441; --vert-profond: #1E4630; --vert-clair: #367A50; --or: #D3AF61; --or-clair: #EFD98F;
    --encre: #141814; --gris: #5d635b; --papier: #FAF9F6; --trait: #d9dfd9; --rouge: #8a1f1f;
    --taille: 16px; --interligne: 1.55; --duree: 320ms;
}
html[lang="ar"] { --taille: 17.5px; --interligne: 1.8; }
html { background: var(--vert-profond); }
body.porte {
    margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
    padding: 0 16px 1rem; color: var(--encre); background: var(--vert-profond); position: relative; overflow-x: hidden;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: var(--taille); line-height: var(--interligne);
}
html[lang="ar"] body.porte { font-family: "Segoe UI", "Noto Naskh Arabic", "Amiri", "Traditional Arabic", sans-serif; }

/* Le fond : trois formes douces aux couleurs de la charte, sans image. */
.porte-fond { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
    background: var(--vert-profond); }
.porte-fond span { position: absolute; border-radius: 50%; }
.porte-fond span:nth-child(1) { width: 900px; height: 900px; inset-inline-start: -450px; top: -640px; background: var(--vert); }
.porte-fond span:nth-child(2) { width: 520px; height: 520px; inset-inline-end: -240px; bottom: -280px; background: var(--vert-clair); }
.porte-fond span:nth-child(3) { width: 160px; height: 160px; inset-inline-end: 6%; top: 90px; border: 2px solid var(--or); opacity: .55; }

.porte-haut, .porte-carte, .porte-pied { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.porte-haut { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; padding: 1rem 0 .9rem; }
.porte-logo { display: inline-flex; background: #fff; border-radius: 12px; padding: .35rem .6rem; }
.porte-logo img { display: block; height: 34px; width: auto; }
.porte-langues { display: flex; gap: .25rem; }
.porte-langues button { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 99px;
    padding: .35rem .7rem; font: inherit; font-size: .85rem; cursor: pointer; min-height: 36px; }
.porte-langues button.active { background: var(--or); color: var(--vert-profond); border-color: var(--or); font-weight: 700; }
.porte-langues button:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 2px; }

.porte-carte { background: #fff; border-radius: 20px; padding: 1.4rem 1.2rem 1.2rem; box-shadow: 0 18px 40px rgba(0,0,0,.25);
    animation: porte-entree var(--duree) ease-out both; }
@keyframes porte-entree { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.porte-carte h1 { font-family: 'Poppins', system-ui, sans-serif; font-weight: 700; font-size: 1.45rem; line-height: 1.25; margin: 0 0 .3rem; color: var(--vert-profond); }
html[lang="ar"] .porte-carte h1 { font-family: inherit; }
.porte-accroche { margin: 0 0 1rem; color: var(--gris); }

/* Les trois étapes, et la barre de progression. */
.porte-etapes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem; font-size: .82rem; }
.porte-etapes li { display: flex; align-items: center; gap: .4rem; color: var(--gris); transition: color var(--duree); }
.porte-etapes .pastille { position: relative; flex: none; width: 1.7rem; height: 1.7rem; border-radius: 50%; border: 2px solid var(--trait);
    display: grid; place-items: center; font-weight: 700; background: #fff; transition: background var(--duree), border-color var(--duree), transform var(--duree); }
.porte-etapes .pastille b, .porte-etapes .pastille i { grid-area: 1 / 1; font-style: normal; transition: opacity var(--duree), transform var(--duree); }
.porte-etapes .pastille i { opacity: 0; transform: scale(.4); color: #fff; }
.porte-etapes li.en-cours { color: var(--vert-profond); font-weight: 600; }
.porte-etapes li.en-cours .pastille { border-color: var(--vert); }
.porte-etapes li.faite { color: var(--vert); }
.porte-etapes li.faite .pastille { background: var(--vert); border-color: var(--vert); transform: scale(1.06); }
.porte-etapes li.faite .pastille b { opacity: 0; transform: scale(.4); }
.porte-etapes li.faite .pastille i { opacity: 1; transform: none; }
.porte-progression { height: 6px; border-radius: 99px; background: #edf1ed; margin: .6rem 0 1.1rem; overflow: hidden; }
.porte-progression span { display: block; height: 100%; width: 100%; background: var(--or); border-radius: inherit;
    transform-origin: left center; transform: scaleX(.04); transition: transform 400ms ease; }
[dir="rtl"] .porte-progression span { transform-origin: right center; }

.porte-alerte { background: #fbeaea; border: 1px solid #e0a8a8; color: var(--rouge); padding: .7rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: .92rem; }
.porte-alerte.info { background: #eef3f8; border-color: #b9c9dc; color: #1f3a5a; }
.porte-alerte.ok { background: #e8f4ee; border-color: #9cc9b2; color: var(--vert-profond); }

.porte-form { margin: 0; }
.porte-champ { margin: 0 0 1.05rem; padding: 0; border: 0; min-width: 0; }
.porte-champ label, .porte-champ legend { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; color: var(--encre); padding: 0; }
.porte-champ input[type="text"], .porte-champ input[type="password"] {
    width: 100%; min-height: 48px; padding: .7rem .85rem; border: 1.5px solid #c3ccc4; border-radius: 12px; font: inherit; font-size: 1.02rem;
    background: #fff; color: var(--encre); text-align: start; transition: border-color 200ms, box-shadow 200ms; }
.porte-champ input:focus { outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(43,100,65,.18); }
.porte-aide { margin: .3rem 0 0; font-size: .82rem; color: var(--gris); }
.porte-mdp { position: relative; }
.porte-mdp input { padding-inline-end: 3.2rem !important; }
.porte-oeil { position: absolute; inset-inline-end: .25rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--vert);
    width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 10px; }
.porte-oeil:focus-visible { outline: 2px solid var(--vert); }
.porte-oeil .barre { opacity: 0; transition: opacity 200ms; }
.porte-oeil[aria-pressed="true"] .barre { opacity: 1; }

.porte-plus { margin-top: .5rem; font-size: .9rem; }
.porte-plus summary { color: var(--vert); cursor: pointer; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.porte-plus p { margin: .35rem 0 0; color: var(--gris); background: var(--papier); border-radius: 10px; padding: .6rem .75rem; }
.porte-qui { text-align: center; margin-top: 1.1rem; }
.porte-qui p { text-align: start; }

/* Le code de vérification : l'image, le nouveau code, les quatre cases. */
.porte-code-image { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .35rem 0 .6rem; }
.porte-code-image img { display: block; width: 210px; max-width: 100%; height: auto; border-radius: 12px; border: 1.5px solid var(--trait); background: var(--papier); }
.porte-nouveau { display: inline-flex; align-items: center; gap: .35rem; color: var(--vert); font-weight: 600; font-size: .9rem; text-decoration: none;
    min-height: 44px; padding: 0 .6rem; border-radius: 10px; border: 1.5px solid var(--trait); background: #fff; }
.porte-nouveau:focus-visible { outline: 2px solid var(--vert); }
.porte-nouveau.tourne svg { animation: porte-tour 400ms ease; }
@keyframes porte-tour { to { transform: rotate(360deg); } }
.porte-lecteur { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.porte-cases { display: flex; gap: .55rem; justify-content: flex-start; }
.porte-champ .porte-cases input { width: 56px; min-height: 0; padding: 0; height: 60px; text-align: center; font-size: 1.6rem; font-weight: 700; border: 1.5px solid #c3ccc4; border-radius: 12px;
    font-family: system-ui, sans-serif; color: var(--vert-profond); background: #fff; transition: border-color 200ms, transform 200ms, box-shadow 200ms; }
.porte-champ .porte-cases input:focus { outline: none; border-color: var(--vert); box-shadow: 0 0 0 3px rgba(43,100,65,.18); transform: translateY(-2px); }
.porte-champ .porte-cases input.rempli { border-color: var(--vert); background: #f3f8f4; }

.porte-souvenir { display: flex; gap: .6rem; align-items: flex-start; margin: 0 0 1rem; font-size: .92rem; cursor: pointer; }
.porte-souvenir input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; flex: none; accent-color: var(--vert); }
.porte-souvenir small { color: var(--gris); }

.porte-entrer { width: 100%; min-height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--vert); color: #fff; border: 0; border-radius: 14px; font: inherit; font-size: 1.08rem; font-weight: 700; cursor: pointer;
    text-decoration: none; transition: background 200ms, transform 200ms; }
.porte-entrer:hover { background: var(--vert-profond); }
.porte-entrer:active { transform: scale(.98); }
.porte-entrer:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; }
[dir="rtl"] .porte-entrer svg, [dir="rtl"] .porte-chambre svg { transform: scaleX(-1); }
.porte-entrer.envoi { opacity: .85; pointer-events: none; }
.porte-entrer.envoi svg { animation: porte-avance 700ms ease-in-out infinite alternate; }
@keyframes porte-avance { to { transform: translateX(5px); } }

/* Le choix de la chambre. */
.porte-chambres { display: grid; gap: .6rem; margin: 0; }
.porte-chambre { display: flex; align-items: center; justify-content: space-between; gap: .8rem; width: 100%; text-align: start;
    background: #fff; border: 1.5px solid var(--trait); border-radius: 14px; padding: .85rem 1rem; font: inherit; color: var(--encre); cursor: pointer;
    animation: porte-entree var(--duree) ease-out both; animation-delay: calc(var(--rang, 0) * 70ms); transition: border-color 200ms, transform 200ms; }
.porte-chambre:hover, .porte-chambre:focus-visible { border-color: var(--vert); transform: translateY(-1px); outline: none; }
.porte-chambre-nom { display: grid; gap: .1rem; }
.porte-chambre-nom strong { color: var(--vert-profond); }
.porte-chambre-nom small { color: var(--gris); }
.porte-chambre svg { color: var(--vert); flex: none; }
.porte-retour { text-align: center; margin: 1rem 0 0; font-size: .9rem; }
.porte-retour a { color: var(--gris); }

/* « La porte s'ouvre ». */
.porte-ouverture { text-align: center; }
.porte-battants { position: relative; width: 120px; height: 150px; margin: .4rem auto 1rem; perspective: 600px;
    border: 4px solid var(--vert-profond); border-bottom-width: 6px; border-radius: 60px 60px 6px 6px; overflow: hidden; background: var(--or-clair); }
.porte-battants .lumiere { position: absolute; inset: 0; background: var(--or); opacity: 0; animation: porte-lumiere 700ms ease-out 150ms forwards; }
.porte-battants .battant { position: absolute; top: 0; bottom: 0; width: 50%; background: var(--vert); z-index: 1; }
.porte-battants .gauche { left: 0; transform-origin: left center; border-right: 1px solid var(--vert-profond); animation: porte-gauche 700ms ease-in-out 100ms forwards; }
.porte-battants .droit { right: 0; transform-origin: right center; border-left: 1px solid var(--vert-profond); animation: porte-droit 700ms ease-in-out 100ms forwards; }
@keyframes porte-gauche { to { transform: rotateY(-80deg); } }
@keyframes porte-droit { to { transform: rotateY(80deg); } }
@keyframes porte-lumiere { to { opacity: 1; } }

.porte-pied { display: flex; align-items: center; justify-content: center; gap: .4rem; color: rgba(255,255,255,.85); font-size: .82rem; padding: 1rem 0 .5rem; margin-top: auto; }
.porte-pied img { background: #fff; border-radius: 50%; padding: 2px; }

/* Lot 105 : l'espace famille du réseau (les enfants, l'espace en veille, les actions). */
.famille-enfant { margin: 0; animation: porte-entree var(--duree) ease-out both; animation-delay: calc(var(--rang, 0) * 70ms); }
.porte-chambre-nom span { color: var(--encre); font-size: .95rem; }
.famille-voir { color: var(--vert) !important; font-weight: 600; }
.famille-veille { text-align: center; background: var(--papier); border: 1.5px dashed var(--trait); border-radius: 14px; padding: 1.2rem 1rem; color: var(--vert-profond); }
.famille-veille p { margin: .3rem 0 0; }
.famille-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--trait); font-size: .92rem; }
.famille-actions a { color: var(--vert); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.famille-actions form { margin: 0; }
.famille-actions button { background: none; border: 1.5px solid var(--trait); border-radius: 10px; min-height: 44px; padding: 0 .9rem; font: inherit; color: var(--gris); cursor: pointer; }

@media (min-width: 720px) {
    body.porte { justify-content: center; }
    .porte-carte { padding: 2rem 2rem 1.6rem; }
    .porte-carte h1 { font-size: 1.7rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
