:root {
    --acces-accent: #dc2626;
    --acces-accent-dark: #b91c1c;
    --acces-ink: #111827;
    --acces-text: #1f2937;
    --acces-muted: #6b7280;
    --acces-border: #e5e7eb;
    --acces-champ: #f9fafb;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body.s2-acces {
    margin: 0;
    min-height: 100vh;
    display: flex;
    background: #fff;
    color: var(--acces-text);
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

.acces-gauche {
    flex: 1;
    background: linear-gradient(135deg, #dc2626 0%, #7f1d1d 40%, #111827 100%);
    color: #fff;
    padding: 60px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}
.acces-gauche::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: repeating-linear-gradient(45deg, transparent, transparent 80px,
                rgba(255, 255, 255, .02) 80px, rgba(255, 255, 255, .02) 82px);
    pointer-events: none;
}
.acces-gauche > * { position: relative; z-index: 2; }

.acces-visuels {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}
.acces-visuels .carousel,
.acces-visuels .carousel-inner,
.acces-visuels .carousel-item { height: 100%; }
.acces-visuels .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.acces-gauche-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(135deg, rgba(220, 38, 38, .65) 0%,
                rgba(127, 29, 29, .75) 40%, rgba(17, 24, 39, .85) 100%);
    pointer-events: none;
}

.acces-marque {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -.5px;
}
.acces-marque .bi {
    font-size: 1.3rem;
    line-height: 1;
    color: #fca5a5;
}
.acces-gauche h1 {
    font-size: 2.6rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -1px;
    margin: 0 0 14px;
}
.acces-gauche .acces-accroche {
    font-size: 1.02rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .85);
    max-width: 460px;
    margin: 0;
}
.acces-pied {
    font-size: .85rem;
    color: rgba(255, 255, 255, .7);
}

.acces-droite {
    width: 480px;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.acces-logo-img {
    display: block;
    margin-bottom: 30px;
    text-align: center;
}
.acces-logo-img img {
    width: 260px;
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.acces-droite h2 {
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -.5px;
    margin: 0 0 6px;
    color: var(--acces-ink);
}
.acces-sous-titre {
    color: var(--acces-muted);
    margin: 0 0 28px;
    font-size: .92rem;
    line-height: 1.5;
}

.acces-groupe { margin-bottom: 18px; }
.acces-etiquette {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.acces-champ { position: relative; }
.acces-champ > .bi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}
.acces-champ input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: 10px;
    border: 1px solid var(--acces-border);
    font-size: .95rem;
    font-family: inherit;
    background: var(--acces-champ);
    color: var(--acces-text);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.acces-champ input:focus {
    background: #fff;
    border-color: var(--acces-accent);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
    outline: none;
}
.acces-champ-mdp input { padding-right: 44px; }
.acces-oeil {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 0;
    padding: 6px 8px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    border-radius: 6px;
}
.acces-oeil:hover { color: #374151; }
.acces-oeil:focus-visible { outline: 2px solid rgba(220, 38, 38, .4); outline-offset: 1px; }
.acces-aide {
    font-size: .78rem;
    color: var(--acces-muted);
    margin: 6px 0 0;
    line-height: 1.45;
}

.acces-bouton {
    display: block;
    width: 100%;
    background: var(--acces-accent);
    color: #fff;
    border: 0;
    padding: 13px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, transform .2s, box-shadow .2s;
}
.acces-bouton:hover {
    background: var(--acces-accent-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, .3);
}
.acces-bouton:focus-visible {
    outline: 3px solid rgba(220, 38, 38, .4);
    outline-offset: 2px;
}
.acces-bouton:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.acces-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: .88rem;
    line-height: 1.45;
    margin-bottom: 18px;
}
.acces-msg[hidden] { display: none !important; }
.acces-msg-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.acces-msg-ok  { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.acces-msg-info { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

.acces-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 4px;
}
.acces-souvenir {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}
.acces-case {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: border-color .15s, background .15s;
}
.acces-case:checked { background: var(--acces-accent); border-color: var(--acces-accent); }
.acces-case:checked::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 0;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}
.acces-case:focus-visible { outline: 2px solid rgba(220, 38, 38, .4); outline-offset: 1px; }

.acces-lien {
    font-size: .82rem;
    color: var(--acces-muted);
    text-decoration: none;
    transition: color .15s;
}
.acces-lien:hover { color: var(--acces-accent); text-decoration: underline; }
.acces-lien-inactif {
    pointer-events: none;
    opacity: .5;
}

.acces-retour { margin-top: 22px; text-align: center; }

.acces-destinataire {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 8px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--acces-ink);
    word-break: break-all;
}
.acces-code {
    width: 100%;
    margin-bottom: 4px;
    padding: 13px 14px;
    border: 1px solid var(--acces-border);
    border-radius: 10px;
    background: var(--acces-champ);
    color: var(--acces-ink);
    text-align: center;
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 11px;
    text-indent: 11px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.acces-code:focus {
    background: #fff;
    border-color: var(--acces-accent);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
    outline: none;
}
.acces-code:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.acces-etape[hidden] { display: none !important; }
.acces-etape .acces-sous-titre { margin-bottom: 12px; }
.acces-etape .acces-groupe { margin-top: 16px; margin-bottom: 0; }
.acces-etape .acces-bouton { margin-top: 16px; }
.acces-etape-pied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.acces-force {
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: #e5e7eb;
    transition: width .3s, background .3s;
}
.acces-force.force-1 { background: #dc2626; width: 25%; }
.acces-force.force-2 { background: #f59e0b; width: 50%; }
.acces-force.force-3 { background: #84cc16; width: 75%; }
.acces-force.force-4 { background: #22c55e; width: 100%; }
.acces-force-libelle { font-size: .78rem; color: var(--acces-muted); margin-top: 4px; min-height: 1.2em; }
.acces-force-libelle.ok { color: #16a34a; }
.acces-force-libelle.ko { color: #dc2626; }
.acces-regles {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    font-size: .8rem;
    color: var(--acces-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}
.acces-regles li { display: flex; align-items: center; gap: 4px; transition: color .2s; }
.acces-regles li.ok { color: #16a34a; }
.acces-regles li.ko { color: #dc2626; }
.acces-regles li .bi { font-size: .75rem; }

@media (max-width: 900px) {
    body.s2-acces { flex-direction: column; }
    .acces-gauche { padding: 36px 28px; min-height: 210px; }
    .acces-gauche h1 { font-size: 1.9rem; }
    .acces-droite { width: 100%; padding: 30px 24px 44px; }
}

@media (max-width: 480px) {
    .acces-code { font-size: 1.25rem; letter-spacing: 8px; text-indent: 8px; }
    .acces-etape-pied { justify-content: center; }
}

.acces-invitation {
    margin: 24px 0 0;
    font-size: .82rem;
    color: #9ca3af;
    text-align: center;
}
.acces-invitation a { color: var(--acces-accent); text-decoration: none; }
