/* Pages d'authentification : feuille de style autonome (aucune dépendance au template). */

:root {
    --marque: #3b6ef0;
    --marque-fonce: #2454d6;
    --texte: #1e293b;
    --texte-doux: #64748b;
    --bordure: #d5dbe6;
    --fond: #f4f6fb;
    --erreur: #d92d3f;
    --succes: #157347;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--texte);
    background: var(--fond);
    -webkit-font-smoothing: antialiased;
}

/* ---------- Structure : volet marque + volet formulaire ---------- */

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 100vh;
}

.auth-brand {
    display: none;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(60rem 30rem at 100% -10%, rgba(59, 110, 240, 0.12), transparent 60%),
        var(--fond);
}

.auth-card {
    width: 100%;
    max-width: 26rem;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 12px 32px rgba(15, 23, 42, 0.08);
}

.auth-mobile-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

@media (min-width: 62rem) {
    .auth-shell {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    }

    .auth-brand {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 2rem;
        padding: 3rem 3.5rem;
        overflow: hidden;
        color: #fff;
        background: linear-gradient(150deg, #0d2260 0%, #1b45bf 55%, #3b6ef0 100%);
    }

    .auth-brand::before,
    .auth-brand::after {
        content: '';
        position: absolute;
        border-radius: 50%;
        pointer-events: none;
    }

    .auth-brand::before {
        width: 26rem;
        height: 26rem;
        right: -9rem;
        top: -8rem;
        background: rgba(255, 255, 255, 0.07);
    }

    .auth-brand::after {
        width: 18rem;
        height: 18rem;
        left: -6rem;
        bottom: -7rem;
        background: rgba(255, 255, 255, 0.06);
    }

    .auth-brand > * {
        position: relative;
        z-index: 1;
    }

    .auth-panel {
        padding: 3rem;
        background: #fff;
    }

    .auth-card {
        padding: 0;
        max-width: 25rem;
        background: transparent;
        box-shadow: none;
    }

    .auth-mobile-logo {
        display: none;
    }
}

/* ---------- Volet marque ---------- */

.auth-brand h2 {
    margin: 0 0 1rem;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-brand p {
    margin: 0;
    max-width: 28rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-features {
    display: grid;
    gap: 1.25rem;
    margin: 2.5rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-features .icone {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.14);
}

.auth-features strong {
    display: block;
    font-weight: 600;
}

.auth-features span {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.72);
}

.auth-copyright {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

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

.auth-titre {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.auth-sous-titre {
    margin: 0 0 2rem;
    color: var(--texte-doux);
}

.field {
    margin-bottom: 1.25rem;
}

.field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.field-control {
    position: relative;
}

.field-control input {
    display: block;
    width: 100%;
    height: 3rem;
    padding: 0 1rem;
    font: inherit;
    color: var(--texte);
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: 0.6rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.field-control input::placeholder {
    color: #9aa5b8;
}

.field-control input:hover {
    border-color: #b6c0d2;
}

.field-control input:focus {
    outline: none;
    border-color: var(--marque);
    box-shadow: 0 0 0 4px rgba(59, 110, 240, 0.16);
}

.field-control.has-error input {
    border-color: var(--erreur);
}

.field-control.has-error input:focus {
    box-shadow: 0 0 0 4px rgba(217, 45, 63, 0.14);
}

.field-control.avec-bouton input {
    padding-right: 3.25rem;
}

.field-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    padding: 0;
    color: var(--texte-doux);
    background: transparent;
    border: 0;
    border-radius: 0.5rem;
    transform: translateY(-50%);
    cursor: pointer;
}

.field-toggle:hover {
    color: var(--texte);
    background: #eef1f7;
}

.field-error {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    color: var(--erreur);
}

.auth-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin: 0.25rem 0 1.75rem;
    font-size: 0.9rem;
}

.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    accent-color: var(--marque);
}

.auth a {
    color: var(--marque);
    font-weight: 500;
    text-decoration: none;
}

.auth a:hover {
    color: var(--marque-fonce);
    text-decoration: underline;
}

.auth-bouton {
    display: block;
    width: 100%;
    height: 3rem;
    padding: 0 1.25rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--marque);
    border: 0;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.auth-bouton:hover {
    background: var(--marque-fonce);
}

.auth-bouton:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(59, 110, 240, 0.3);
}

.auth-pied {
    margin: 1.75rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--texte-doux);
}

.auth-alerte {
    margin: 0 0 1.5rem;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    border-radius: 0.6rem;
}

.auth-alerte.succes {
    color: var(--succes);
    background: #e7f5ee;
    border: 1px solid #b7e0c9;
}

/* ---------- Choix de la formule (inscription) ---------- */

.plans-choix {
    display: grid;
    gap: 0.6rem;
}

.plan-choix {
    display: block;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

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

.plan-choix-corps {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bordure);
    border-radius: 0.6rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.plan-choix-corps small {
    grid-column: 1;
    color: var(--texte-doux);
}

.plan-choix-prix {
    grid-column: 2;
    grid-row: 1 / span 2;
    font-weight: 700;
    color: var(--marque-fonce);
}

.plan-choix-barre {
    margin-right: 0.35rem;
    font-weight: 400;
    color: #94a3b8;
}

.plan-choix-promo {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #ffedd5;
    color: #c2410c;
    font-weight: 700;
}

.inscription-promo {
    margin-bottom: 1rem;
}

.plan-choix:hover .plan-choix-corps {
    border-color: #b6c0d2;
}

.plan-choix input:checked + .plan-choix-corps {
    background: #f3f7ff;
    border-color: var(--marque);
    box-shadow: 0 0 0 3px rgba(59, 110, 240, 0.16);
}

.plan-choix input:focus-visible + .plan-choix-corps {
    box-shadow: 0 0 0 4px rgba(59, 110, 240, 0.3);
}

/* ---------- Choix de la boutique (page intermédiaire après connexion) ---------- */

.choix-page {
    min-height: 100vh;
    background:
        radial-gradient(60rem 30rem at 100% -10%, rgba(59, 110, 240, 0.1), transparent 60%),
        var(--fond);
}

.choix-conteneur {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.choix-entete {
    background: #fff;
    border-bottom: 1px solid var(--bordure);
}

.choix-entete .choix-conteneur {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 4.25rem;
}

.choix-utilisateur {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--texte-doux);
}

.choix-lien {
    padding: 0;
    font: inherit;
    font-weight: 500;
    color: var(--marque);
    background: none;
    border: 0;
    cursor: pointer;
}

.choix-lien:hover {
    color: var(--marque-fonce);
    text-decoration: underline;
}

.choix-page main {
    padding-top: 3rem;
    padding-bottom: 4rem;
}

.choix-recherche input {
    width: 100%;
    height: 3rem;
    margin-bottom: 1.25rem;
    padding: 0 1rem;
    font: inherit;
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: 0.6rem;
}

.choix-recherche input:focus {
    outline: none;
    border-color: var(--marque);
    box-shadow: 0 0 0 4px rgba(59, 110, 240, 0.16);
}

.choix-grille {
    display: grid;
    gap: 0.9rem;
}

@media (min-width: 40rem) {
    .choix-grille {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.choix-carte-form {
    margin: 0;
}

.choix-carte {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.15rem;
    font: inherit;
    color: var(--texte);
    text-align: left;
    background: #fff;
    border: 1px solid var(--bordure);
    border-radius: 0.9rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.choix-carte:hover {
    border-color: var(--marque);
    box-shadow: 0 10px 26px rgba(59, 110, 240, 0.14);
    transform: translateY(-1px);
}

.choix-carte.active {
    border-color: var(--marque);
    box-shadow: 0 0 0 3px rgba(59, 110, 240, 0.16);
}

.choix-avatar {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 2.9rem;
    height: 2.9rem;
    font-weight: 700;
    color: var(--marque-fonce);
    background: #eaf0ff;
    border-radius: 0.8rem;
}

.choix-carte.administration .choix-avatar {
    color: #fff;
    background: linear-gradient(135deg, #4680ff, #2454d6);
}

.choix-corps {
    flex: 1;
    min-width: 0;
}

.choix-corps strong,
.choix-corps small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.choix-corps small {
    color: var(--texte-doux);
}

.choix-etat {
    flex-shrink: 0;
    padding: 0.15rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    color: var(--succes);
    background: #e7f5ee;
}

.choix-etat.essai {
    color: #0c6b7d;
    background: #e0f4f8;
}

.choix-etat.expire {
    color: var(--erreur);
    background: #fdeaec;
}

.choix-fleche {
    flex-shrink: 0;
    color: var(--texte-doux);
}

.choix-carte:hover .choix-fleche {
    color: var(--marque);
}

/* ---------- Stepper (inscription) ---------- */

.stepper {
    display: flex;
    align-items: flex-start;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
}

.stepper li {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.stepper li:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 1.1rem;
    left: calc(50% + 1.4rem);
    right: calc(-50% + 1.4rem);
    height: 2px;
    background: var(--bordure);
}

.stepper li.fait:not(:last-child)::after {
    background: var(--marque);
}

.stepper span {
    display: grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--texte-doux);
    background: #fff;
    border: 2px solid var(--bordure);
    border-radius: 50%;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.stepper em {
    font-size: 0.8rem;
    font-style: normal;
    color: var(--texte-doux);
}

.stepper li.actif span {
    color: #fff;
    background: var(--marque);
    border-color: var(--marque);
}

.stepper li.actif em {
    font-weight: 600;
    color: var(--texte);
}

.stepper li.fait span {
    color: var(--marque);
    border-color: var(--marque);
}

.avec-stepper .etape:not(.actif) {
    display: none;
}

.etape-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

/* Sans JavaScript : toutes les étapes sont visibles et seul le bouton d'envoi est proposé. */
.etape-actions [data-suivant],
.etape-actions [data-precedent] {
    display: none;
}

.avec-stepper .etape-actions [data-suivant] {
    display: block;
}

.avec-stepper .etape-actions [data-precedent]:not([hidden]) {
    display: block;
    flex: 0 0 auto;
    width: auto;
}

.avec-stepper .etape-actions [data-soumettre] {
    display: none;
}

.avec-stepper.derniere-etape .etape-actions [data-suivant] {
    display: none;
}

.avec-stepper.derniere-etape .etape-actions [data-soumettre] {
    display: block;
}

.auth-bouton.secondaire {
    color: var(--texte);
    background: #fff;
    border: 1px solid var(--bordure);
}

.auth-bouton.secondaire:hover {
    background: #f4f6fb;
}

.recap {
    margin: 0 0 1.25rem;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: var(--texte-doux);
    background: #f4f6fb;
    border-radius: 0.6rem;
}

.recap strong {
    color: var(--texte);
}
