/* Pages de connexion, inscription, mot de passe oublié, confirmation, déverrouillage.
   Même direction artistique que l'espace client : fond gris, carte blanche arrondie sans ombre,
   champs gris, boutons en pilule, panneau bleu nuit à gauche et carte du formulaire à droite. */

:root {
    --primary-color: var(--hc-navy);
}

html,
body {
    min-height: 100%;
}
body {
    margin: 0;
    background: var(--hc-grey);
    color: var(--hc-ink);
    font-family: var(--hc-font);
    -webkit-font-smoothing: antialiased;
}

.auth-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    min-height: 100vh;
    padding: 1.25rem;
}

/* Colonne de gauche : logo, carte du formulaire, lien vers l'autre parcours */
.auth-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    padding: 1.25rem 1rem 0.5rem;
}
.auth-logo {
    align-self: flex-start;
    margin-bottom: 1.5rem;
}
.auth-logo img {
    display: block;
    height: 34px;
    width: auto;
}
.auth-form-wrapper {
    width: 100%;
    max-width: 460px !important;
    margin: auto 0;
    padding: 2.25rem !important;
    border-radius: var(--hc-radius-lg, 24px);
    background: var(--hc-surface);
}
#hc-register .auth-form-wrapper {
    max-width: 620px !important;
}
.auth-title {
    margin: 0 0 0.4rem;
    color: var(--hc-navy);
    font: 700 1.9rem/1.15 var(--hc-font) !important;
    letter-spacing: -0.02em;
}
.auth-subtitle,
.auth-form-wrapper p.text-muted {
    margin: 0 0 1.5rem;
    color: var(--hc-muted) !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}
.auth-title + form,
.auth-title + .hc-flash-toast + form {
    margin-top: 1.5rem;
}

/* Carte suivie du bloc « autre parcours » : les deux restent groupés au centre */
.auth-form-wrapper:has(+ .auth-create-section) {
    margin-bottom: 0;
}

/* Champs */
.form-group {
    margin-bottom: 1.1rem;
}
.form-label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--hc-navy);
    font-size: 0.9375rem;
    font-weight: 600;
}
.auth-container .form-control,
.auth-container select.form-control {
    width: 100%;
    height: 3rem;
    padding: 0 1.15rem;
    border: 1.5px solid transparent;
    border-radius: 14px !important;
    background-color: var(--hc-grey);
    box-shadow: none;
    color: var(--hc-navy);
    font: 500 1rem/1.3 var(--hc-font);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.auth-container .form-control::placeholder {
    color: #9aa5b8;
    font-weight: 400;
}
.auth-container .form-control:focus {
    border-color: var(--hc-blue);
    background-color: #fff;
    box-shadow: none;
    outline: 0;
}
.auth-container .form-control.is-invalid {
    border-color: #d9534f;
    background-image: none;
}
.auth-container .form-control:-webkit-autofill,
.auth-container .form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--hc-navy);
    box-shadow: 0 0 0 100px var(--hc-grey) inset;
}
.auth-container .form-text,
.auth-container small.text-muted {
    display: block;
    margin-top: 0.4rem;
    color: var(--hc-muted) !important;
    font-size: 0.875rem;
}

/* Champ mot de passe avec icônes (inscription) : un seul bloc gris */
.auth-container .input-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background: var(--hc-grey);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.auth-container .input-group:focus-within {
    border-color: var(--hc-blue);
    background: #fff;
}
.auth-container .input-group .form-control {
    flex: 1 1 auto;
    min-width: 0;
    height: calc(3rem - 3px);
    padding: 0 0.4rem;
    border: 0 !important;
    background: none !important;
}
.auth-container .input-group-text {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    border: 0 !important;
    background: none !important;
    color: var(--hc-gray-500);
}
.auth-container .input-group-text.cursor-pointer,
.auth-container .input-group-text[onclick] {
    cursor: pointer;
}
.auth-container .input-group-text[onclick]:hover {
    color: var(--hc-blue);
}

/* Se souvenir de moi / mot de passe oublié */
.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.2rem 0 1.4rem;
}
.auth-remember,
.auth-container .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    color: var(--hc-gray-600);
    font-size: 0.9375rem;
    cursor: pointer;
}
.auth-remember input[type="checkbox"],
.auth-container .form-check-input {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
    margin: 0;
    float: none;
    border: 1.5px solid #c5ccd9;
    border-radius: 6px;
    accent-color: var(--hc-blue);
    cursor: pointer;
}
.auth-container .form-check-label {
    color: var(--hc-gray-600) !important;
    font-size: 0.9375rem !important;
}
.forgot-password {
    display: inline-block;
    margin-top: 1.1rem;
    color: var(--hc-blue);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}
.forgot-password--inline {
    margin-top: 0;
}
.forgot-password:hover {
    color: var(--hc-navy);
    text-decoration: underline;
}

/* Boutons en pilule */
.btn-primary-auth,
.btn-create-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 3rem;
    padding: 0 1.6rem;
    border-radius: var(--hc-pill, 999px);
    font: 700 1rem/1 var(--hc-font);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn-primary-auth {
    width: 100%;
    border: 0;
    background: var(--hc-blue);
    color: #fff;
}
.btn-primary-auth:hover {
    background: var(--hc-navy);
    color: #fff;
}
.btn-create-outline {
    border: 1.5px solid var(--hc-line);
    background: var(--hc-surface);
    color: var(--hc-navy);
}
.btn-create-outline:hover {
    border-color: var(--hc-navy);
    color: var(--hc-navy);
}

/* Sous la carte : question courte et bouton, sur une ligne */
.auth-create-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem 1rem;
    width: 100%;
    max-width: 460px;
    margin: 1rem 0 auto;
    padding: 1rem 1rem 1rem 1.5rem;
    border-radius: var(--hc-radius-lg, 24px);
    background: var(--hc-surface);
}
#hc-register .auth-create-section {
    max-width: 620px;
}
.create-question,
.auth-create-section .create-subtitle {
    margin: 0 !important;
    color: var(--hc-navy);
    font-size: 1rem;
    font-weight: 600;
}
.create-question + .create-subtitle {
    display: none;
}
.auth-create-section .btn-create-outline {
    min-height: 2.6rem;
    margin-left: auto;
    background: var(--hc-grey);
    border-color: transparent;
}
.auth-create-section .btn-create-outline:hover {
    background: var(--hc-navy);
    color: #fff;
}

/* Pastille d'état des pages de résultat (e-mail envoyé, compte confirmé, lien expiré…) */
.auth-mark {
    display: grid;
    place-items: center;
    width: 3.75rem;
    height: 3.75rem;
    margin: 0 auto 1.25rem;
    border-radius: 50%;
    background: var(--hc-grey);
    color: var(--hc-gray-500);
    font-size: 1.35rem;
}
.auth-mark--ok { background: #e3f4ea; color: #1a9a5c; }
.auth-mark--warn { background: #fdf3d7; color: #b7791f; }
.auth-mark--bad { background: #fbe6e5; color: #c9463f; }
.auth-form-wrapper.text-center .auth-subtitle,
.auth-form-wrapper .text-center .auth-subtitle {
    margin-bottom: 1.5rem;
}
.auth-logout-link {
    color: var(--hc-gray-500);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}
.auth-logout-link:hover {
    color: #c9463f;
}

/* Panneau bleu nuit arrondi, placé à gauche ; message en bas */
.auth-right {
    order: -1;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 3rem;
    border-radius: var(--hc-radius-lg, 24px);
    background: var(--hc-navy);
}
.auth-right::before {
    content: "";
    position: absolute;
    top: -22%;
    right: -18%;
    width: 70%;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 0 0 5rem rgba(255, 255, 255, 0.025), 0 0 0 10rem rgba(255, 255, 255, 0.02);
}
.promo-bg-gradient {
    display: none;
}
.promo-content {
    position: relative;
    max-width: 30rem;
}
.promo-title {
    margin: 0 0 0.8rem;
    color: #fff;
    font: 700 2.5rem/1.1 var(--hc-font);
    letter-spacing: -0.02em;
}
.promo-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.0625rem;
    line-height: 1.55;
}

/* Messages restés dans la page (les retours d'action passent en notification en haut à droite) */
.auth-container .alert {
    margin-bottom: 1.25rem;
    padding: 0.8rem 1rem;
    border: 0;
    border-radius: 14px;
    background: var(--hc-grey);
    color: var(--hc-navy);
    font-size: 0.9375rem;
}

/* Pied de page */
.footer-area {
    display: none;
}

@media (max-width: 991.98px) {
    .auth-container {
        grid-template-columns: minmax(0, 1fr);
        padding: 0.75rem;
    }
    .auth-right {
        display: none;
    }
    .auth-left {
        padding: 1rem 0 1.5rem;
    }
    .auth-logo {
        align-self: center;
    }
    .auth-form-wrapper {
        margin-top: 0;
        padding: 1.5rem !important;
    }
}

/* ==========================================================================
   28. Notifications « toast »
   En haut à droite, sous la barre du haut : carte blanche arrondie, icône dans
   un rond de couleur, titre bleu marine, texte gris. Générées par hcToast()
   (js/core/utils.js) ; toutes les pages passent par elle.
   ========================================================================== */

.hc-toasts {
    position: fixed;
    top: 5.5rem;
    right: 1.25rem;
    z-index: 10100;
    display: grid;
    gap: 0.6rem;
    width: min(24rem, calc(100vw - 2rem));
    pointer-events: none;
}
.hc-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 0.8rem 0.95rem 1rem;
    border: 1px solid var(--hc-line, #e6e9ee);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
    font-family: var(--hc-font, system-ui, sans-serif);
    pointer-events: auto;
    animation: hc-toast-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.hc-toast.is-leaving {
    animation: hc-toast-out 0.26s ease-in both;
}
@keyframes hc-toast-in {
    from { opacity: 0; transform: translateX(1.5rem); }
}
@keyframes hc-toast-out {
    to { opacity: 0; transform: translateX(1.5rem); }
}
.hc-toast__icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 50%;
    background: var(--hc-blue-50, #edf4fd);
    color: var(--hc-blue, #066fd1);
    font-size: 0.95rem;
}
.hc-toast--success .hc-toast__icon {
    background: #179a55;
    color: #fff;
}
.hc-toast--error .hc-toast__icon {
    background: #d5372b;
    color: #fff;
}
.hc-toast--warning .hc-toast__icon {
    background: #fdf3df;
    color: #b45309;
}
.hc-toast__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    padding-top: 0.05rem;
}
.hc-toast__body b {
    color: var(--hc-navy, #162e62);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}
.hc-toast__body span {
    color: var(--hc-gray-500, #64748b);
    font-size: 0.9rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.hc-toast__close {
    display: grid;
    flex: none;
    place-items: center;
    width: 1.875rem;
    height: 1.875rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--hc-gray-400, #94a3b8);
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.hc-toast__close:hover {
    background: var(--hc-grey, #f3f4f7);
    color: var(--hc-navy, #162e62);
}
@media (max-width: 575.98px) {
    .hc-toasts {
        top: 4.75rem;
        right: 1rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    .hc-toast,
    .hc-toast.is-leaving {
        animation: none;
    }
}

/* Panneau bleu collé aux bords : il occupe toute la moitié gauche de l'écran, sur toute la hauteur */
@media (min-width: 992px) {
    .auth-container {
        gap: 0;
        padding: 0;
    }
    .auth-right {
        position: sticky;
        top: 0;
        height: 100vh;
        padding: 3.5rem;
        border-radius: 0;
    }
    .auth-left {
        padding: 2rem 2rem 1.5rem;
    }
}

/* Logo posé juste au-dessus de la carte, aligné sur son bord gauche ; carte agrandie de 10 % */
.auth-logo {
    align-self: center;
    width: 100%;
    max-width: 506px;
    margin: auto 0 1.25rem;
    padding-left: 0.25rem;
}
.auth-logo img {
    height: 38px;
}
.auth-form-wrapper {
    max-width: 506px !important;
    margin-top: 0;
    padding: 2.5rem !important;
}
.auth-create-section {
    max-width: 506px;
}
#hc-register .auth-logo,
#hc-register .auth-create-section {
    max-width: 682px;
}
#hc-register .auth-form-wrapper {
    max-width: 682px !important;
}
@media (max-width: 991.98px) {
    .auth-logo {
        margin-top: 0;
    }
    .auth-form-wrapper {
        padding: 1.5rem !important;
    }
}

/* Logo centré au-dessus de la carte ; carte encore agrandie */
.auth-logo {
    max-width: 580px;
    margin-bottom: 1.5rem;
    padding-left: 0;
    text-align: center;
}
.auth-logo img {
    display: inline-block;
    height: 42px;
}
.auth-form-wrapper {
    max-width: 580px !important;
    padding: 3rem !important;
}
.auth-create-section {
    max-width: 580px;
    padding: 1.1rem 1.1rem 1.1rem 1.75rem;
}
.auth-title {
    font-size: 2.2rem !important;
}
.auth-container .form-control,
.auth-container select.form-control,
.btn-primary-auth {
    height: 3.3rem;
    min-height: 3.3rem;
}
.auth-container .input-group .form-control {
    height: calc(3.3rem - 3px);
    min-height: 0;
}
#hc-register .auth-logo,
#hc-register .auth-create-section {
    max-width: 740px;
}
#hc-register .auth-form-wrapper {
    max-width: 740px !important;
}
@media (max-width: 991.98px) {
    .auth-form-wrapper {
        padding: 1.5rem !important;
    }
}

/* Bouton du bloc « autre parcours » (Ouvrir un compte, Connexion) : petit */
.auth-create-section {
    flex-wrap: nowrap;
    padding: 0.8rem 0.8rem 0.8rem 1.5rem;
}
.auth-create-section .btn-create-outline {
    flex: none;
    min-height: 2rem;
    padding: 0 0.9rem;
    font-size: 0.8125rem;
    font-weight: 600;
}
.create-question,
.auth-create-section .create-subtitle {
    font-size: 0.9375rem;
}
@media (max-width: 575.98px) {
    .auth-create-section {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   App auth (Laravel) — compléments : remplacent les quelques classes Bootstrap / Volt
   et les icônes Font Awesome que l'ancien gabarit chargeait (aucune bibliothèque externe ici).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
a { color: var(--hc-blue); }
img { max-width: 100%; }
.text-center { text-align: center; }
.text-muted { color: var(--hc-muted); }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.d-grid { display: grid; }
.gap-2 { gap: 0.5rem; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.small { font-size: 0.875rem; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

/* Grille du formulaire d'inscription (row g-3 / col-md-6 / col-12) */
.row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.row > [class^="col-"], .row > [class*=" col-"] { grid-column: span 12; min-width: 0; }
@media (min-width: 768px) {
    .row > .col-md-6 { grid-column: span 6; }
}

/* Icônes SVG en ligne (remplacent Font Awesome) */
.ico { display: inline-block; width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
.auth-mark .ico { width: 1.35rem; height: 1.35rem; }
.auth-mark--idle { background: var(--hc-grey); color: var(--hc-gray-500); }
.hc-toast__icon .ico, .hc-toast__close .ico { width: 0.95rem; height: 0.95rem; }

/* Bouton « œil » des champs mot de passe et « Générer » */
.auth-container .input-group-text.cursor-pointer { background: none; border: 0; font: inherit; }
button.input-group-text { cursor: pointer; }

/* Liens d'action présentés comme des liens (renvoyer le code, se déconnecter) */
.auth-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hc-blue);
    font: 600 0.9375rem/1.4 var(--hc-font);
    cursor: pointer;
}
.auth-link-button:hover { color: var(--hc-navy); text-decoration: underline; }
.auth-link-button.auth-logout-link { color: var(--hc-gray-500); }
.auth-link-button.auth-logout-link:hover { color: #c9463f; text-decoration: none; }
.auth-inline-form { display: inline; margin: 0; }
.auth-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.5rem; margin-top: 1.5rem; }

/* Turnstile (anciennement en <style> dans la page) */
.hc-turnstile { margin: 0.75rem 0 0; }
.hc-turnstile:empty { margin: 0; }
form [data-ts-locked] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* Pages d'erreur */
.auth-error-code { margin: 0 0 0.5rem; color: var(--hc-gray-400); font: 700 0.9375rem/1 var(--hc-font); letter-spacing: 0.08em; }

/* Sélecteur de langue (bas de colonne) */
.auth-lang { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.9rem; margin: 1.25rem 0 0; padding: 0; list-style: none; font-size: 0.875rem; }
.auth-lang a { color: var(--hc-gray-500); font-weight: 600; text-decoration: none; }
.auth-lang a:hover, .auth-lang a[aria-current="true"] { color: var(--hc-navy); }

/* Étapes d'inscription : boutons masqués / affichés par auth.js (plus d'attribut style="") */
.is-hidden { display: none !important; }
.is-invisible { visibility: hidden !important; }
