/* =========================================================================
   SOS IT - Auth pages (login, SSO, forgot, OTP, reset, force-change)
   Tokens alignés sos-shell-v2 · Lucide · rouge SOS · light/dark
   ========================================================================= */

.sos-auth-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    background: var(--bg-color, #ffffff);
    color: var(--text-primary, #18181b);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    isolation: isolate;
}

/* Carte / wrap auth au-dessus de la photo body::before */
.sos-auth-body .sos-auth-wrap,
.sos-auth-body .sos-req,
.sos-auth-body .sos-sso,
.sos-auth-body .sos-sso-page,
.sos-auth-body .sos-auth-accent,
.sos-auth-body .error-toast {
    position: relative;
    z-index: 2;
}

.sos-auth-body .sos-auth-card,
.sos-auth-body .sos-req__card,
.sos-auth-body .sos-sso__card {
    background: var(--surface-color, #fff);
}

.sos-auth-bg {
    display: none !important;
}

.sos-auth-accent {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 100;
    background: #dc2626;
}

/* Ligne haute : retour (gauche) + toggle thème (droite) */
.sos-auth-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0 0 0.45rem;
    min-height: 1.75rem;
    position: relative;
    z-index: 2;
}

.sos-auth-card__top .sos-auth-back {
    margin-bottom: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary, #52525b);
    white-space: nowrap;
}

.sos-auth-card__top .sos-auth-back:hover {
    color: #dc2626;
}

.sos-auth-card__top .sos-auth-card__theme {
    position: static;
    top: auto;
    right: auto;
    margin-left: auto;
    flex-shrink: 0;
}

/* Toggle thème - dans la carte, pas en FAB hors écran */
.sos-auth-theme-fab {
    display: none !important;
}

.sos-auth-card__theme {
    position: absolute;
    top: 0.875rem;
    right: 0.875rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: none;
}

.sos-auth-card {
    position: relative;
}

.sos-auth-wrap {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 360px;
    padding: 0.75rem 0.85rem;
}

.sos-auth-wrap--wide {
    max-width: 920px;
}

.sos-auth-brand {
    text-align: center;
    margin-bottom: 0.75rem;
}

.sos-auth-brand__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    background: #dc2626;
    border-radius: 0.55rem;
    margin-bottom: 0.4rem;
    color: #fff;
}

.sos-auth-brand__icon--logo {
    width: 3.75rem;
    height: 3.75rem;
    background: transparent;
    border-radius: 0.75rem;
    padding: 0;
    overflow: hidden;
}

.sos-auth-brand__icon--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sos-auth-brand__icon .lucide-icon,
.sos-auth-brand__icon svg {
    width: 1.15rem;
    height: 1.15rem;
    color: #fff;
    stroke: #fff;
}

.sos-auth-brand__title {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.15;
}

.sos-auth-brand__sub {
    font-size: 0.72rem;
    color: var(--text-muted, #a1a1aa);
    margin-top: 0.15rem;
    line-height: 1.3;
}

.sos-auth-card {
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: 0.85rem;
    padding: 1rem 1rem 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .sos-auth-card {
    background: var(--surface-color);
    border-color: var(--border-color);
}

.sos-auth-badge-row {
    display: flex;
    justify-content: center;
    margin-bottom: 0.7rem;
}

.sos-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--primary-light, #fef2f2);
    color: var(--primary, #dc2626);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.sos-auth-badge .lucide-icon,
.sos-auth-badge svg {
    width: 14px;
    height: 14px;
}

.sos-auth-field {
    margin-bottom: 0.65rem;
}

.sos-auth-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #18181b);
    margin-bottom: 0.35rem;
}

.sos-auth-field-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-strong, #d4d4d8);
    border-radius: 0.625rem;
    background: var(--bg-color, #fafafa);
    padding: 0 0.75rem;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    overflow: hidden;
    max-width: 100%;
}

.sos-auth-field-box:hover {
    border-color: var(--border-strong, #d4d4d8);
    background: var(--surface-color, #fff);
}

.sos-auth-field-box:focus-within {
    border-color: #a1a1aa;
    background: var(--surface-color, #fff);
    box-shadow: none;
}

.sos-auth-field-box .fi {
    width: 17px;
    height: 17px;
    color: var(--text-muted, #a1a1aa);
    flex-shrink: 0;
}

.sos-auth-field-box:focus-within .fi {
    color: #71717a;
}

.sos-auth-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.7rem 0.6rem;
    font-size: 0.875rem;
    color: var(--text-primary, #18181b);
    font-family: inherit;
    min-width: 0;
}

.sos-auth-input::placeholder {
    color: var(--text-muted, #a1a1aa);
}

.sos-auth-domain {
    font-size: 0.8rem;
    color: var(--text-secondary, #71717a);
    font-weight: 600;
    white-space: nowrap;
    padding-right: 0.25rem;
}

.sos-auth-pwd-toggle {
    cursor: pointer;
    color: var(--text-muted, #a1a1aa);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.sos-auth-pwd-toggle:hover {
    color: var(--text-primary, #18181b);
    background: var(--bg-color, #f4f4f5);
}

.sos-auth-pwd-toggle .lucide-icon,
.sos-auth-pwd-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
    stroke-width: 1.75;
}

.sos-auth-forgot {
    text-align: right;
    margin-top: -0.2rem;
    margin-bottom: 0.7rem;
}

.sos-auth-forgot a {
    font-size: 0.75rem;
    color: var(--text-muted, #a1a1aa);
    text-decoration: none;
}

.sos-auth-forgot a:hover {
    color: #dc2626;
}

.sos-auth-submit {
    width: 100%;
    padding: 0.55rem;
    min-height: 2.35rem;
    border: none;
    border-radius: 0.55rem;
    background: #dc2626;
    color: #fff;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: background 0.15s;
}

.sos-auth-submit:hover {
    background: #b91c1c;
    color: #fff;
}

.sos-auth-submit:active {
    background: #991b1b;
    color: #fff;
}

.sos-auth-submit .lucide-icon,
.sos-auth-submit svg {
    width: 18px;
    height: 18px;
    color: inherit;
    stroke: currentColor;
}

/* Liens bouton primaire : texte blanc (évite a:hover global rouge) */
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary),
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):visited {
    color: #fff;
    text-decoration: none;
}
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):hover,
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):focus,
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):active {
    color: #fff !important;
    text-decoration: none;
}
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):hover .lucide-icon,
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):hover svg,
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):focus .lucide-icon,
a.sos-auth-submit:not(.sos-auth-submit--ghost):not(.sos-auth-submit--secondary):focus svg {
    color: #fff !important;
    stroke: #fff !important;
}

.sos-auth-submit--secondary {
    margin-top: 0.55rem;
    background: var(--surface-color, #fff);
    color: #dc2626;
    border: 1px solid #fca5a5;
    box-shadow: none;
}
.sos-auth-submit--secondary:hover,
.sos-auth-submit--secondary:focus,
.sos-auth-submit--secondary:active {
    background: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c !important;
}
.sos-auth-submit--secondary .lucide-icon,
.sos-auth-submit--secondary svg {
    color: #dc2626;
    stroke: currentColor;
}
a.sos-auth-submit--secondary,
a.sos-auth-submit--secondary:visited {
    color: #dc2626;
    text-decoration: none;
}
a.sos-auth-submit--secondary:hover,
a.sos-auth-submit--secondary:focus,
a.sos-auth-submit--secondary:active {
    color: #b91c1c !important;
    text-decoration: none;
}
a.sos-auth-submit--secondary:hover .lucide-icon,
a.sos-auth-submit--secondary:hover svg {
    color: #b91c1c !important;
    stroke: #b91c1c !important;
}

.sos-auth-err {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: var(--primary-light, #fef2f2);
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    margin-bottom: 1.25rem;
}

.sos-auth-err .lucide-icon {
    width: 16px;
    height: 16px;
    color: #dc2626;
    flex-shrink: 0;
}

.sos-auth-err span {
    font-size: 0.8rem;
    color: #991b1b;
}

[data-theme="dark"] .sos-auth-err span {
    color: #fecaca;
}

.sos-auth-portal-wrap {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #f0f0f0);
    display: flex;
    justify-content: center;
}

.sos-auth-portal {
    display: inline-flex;
    position: relative;
    background: var(--bg-color, #f4f4f5);
    padding: 4px;
    border-radius: 0.75rem;
    gap: 2px;
    z-index: 1;
}

.sos-auth-portal__slider {
    position: absolute;
    top: 4px;
    left: 4px;
    bottom: 4px;
    background: var(--surface-color, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.04));
    border-radius: 0.5rem;
    z-index: -1;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), width 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

.sos-auth-portal a {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    color: var(--text-muted, #888);
    text-decoration: none;
    border: 1px solid transparent;
    position: relative;
}

.sos-auth-portal a:hover {
    color: var(--text-secondary, #444);
}

.sos-auth-portal a.active {
    color: #dc2626 !important;
}

.sos-auth-foot {
    text-align: center;
    margin-top: 0.85rem;
}

.sos-auth-foot__copy {
    font-size: 0.65rem;
    color: var(--text-muted, #a1a1aa);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.45rem;
}

.sos-auth-foot__copy a {
    color: var(--text-secondary, #71717a);
    text-decoration: none;
    font-weight: 600;
}

.sos-auth-foot__copy a:hover {
    color: #dc2626;
}

.sos-auth-foot__dot {
    opacity: 0.4;
}

.sos-auth-foot__version {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted, #a1a1aa);
    white-space: nowrap;
}

.sos-auth-foot__logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.35rem;
}

.sos-auth-foot__logo img {
    height: 14px;
    width: auto;
    opacity: 0.4;
    filter: grayscale(100%);
    transition: opacity 0.2s, filter 0.2s;
}

.sos-auth-foot__logo img:hover {
    opacity: 0.7;
    filter: grayscale(0%);
}

.sos-auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #71717a);
    text-decoration: none;
    margin-bottom: 1rem;
}

.sos-auth-back:hover {
    color: #dc2626;
}

.sos-auth-hint {
    font-size: 0.8125rem;
    color: var(--text-secondary, #52525b);
    line-height: 1.5;
    margin: 0 0 1.25rem;
    text-align: center;
}

/* SSO two-column (legacy - conservé si réutilisé) */
.sos-auth-sso-grid {
    display: flex;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
    border: 1px solid var(--border-color, #e4e4e7);
    background: var(--surface-color, #fff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sos-auth-sso-guide {
    flex: 1.15;
    padding: 2rem;
    background: var(--surface-color, #fff);
    border-right: 1px solid var(--border-color, #e4e4e7);
}

.sos-auth-sso-guide h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #18181b);
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sos-auth-sso-guide h2 .lucide-icon {
    color: #dc2626;
    width: 1.25rem;
    height: 1.25rem;
}

.sos-auth-sso-guide .intro {
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

.sos-auth-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sos-auth-step {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
}

.sos-auth-step__icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #fef2f2;
    color: #dc2626;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sos-auth-step__icon .lucide-icon {
    width: 1.125rem;
    height: 1.125rem;
}

.sos-auth-step h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary, #18181b);
    margin: 0 0 0.2rem;
}

.sos-auth-step p {
    font-size: 0.8rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.45;
    margin: 0;
}

.sos-auth-sso-action {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sos-auth-btn-google {
    width: 100%;
    max-width: 280px;
    padding: 0.875rem 1.25rem;
    background: var(--surface-color, #fff);
    color: var(--text-primary, #18181b);
    border: 1px solid var(--border-strong, #d4d4d8);
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
}

.sos-auth-btn-google:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.sos-auth-btn-google svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.sos-auth-logo-box {
    width: 72px;
    height: 72px;
    background: var(--surface-color, #fff);
    border-radius: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color, #e4e4e7);
}

.sos-auth-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.sos-auth-logo-box .fallback {
    width: 100%;
    height: 100%;
    background: #dc2626;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sos-auth-logo-box .fallback .lucide-icon {
    width: 32px;
    height: 32px;
    color: #fff;
}

@media (max-width: 850px) {
    .sos-auth-sso-grid {
        flex-direction: column;
    }

    .sos-auth-sso-guide {
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e4e4e7);
    }

    .sos-auth-sso-guide,
    .sos-auth-sso-action {
        padding: 1.5rem;
    }
}

/* -------------------------------------------------------------------------
   Staff login - même coque que SSO (carte / top / pied), champs password
   ---------------------------------------------------------------------- */
.sos-auth-body--staff .sos-sso {
    max-width: 26rem;
}

.sos-sso__card--staff {
    gap: 0.65rem;
}

/* Cadre pointillé autour des formulaires auth (login / SSO / forgot / OTP / reset) */
.sos-staff-form,
.sos-auth-form-box {
    width: 100%;
    box-sizing: border-box;
    margin: 0.15rem 0 0;
    padding: 1rem 1.05rem 1.05rem;
    border: 1px dashed var(--border-color, #d4d4d8);
    border-radius: 0.65rem;
    background: var(--bg-color, #fafafa);
}

[data-theme="dark"] .sos-staff-form,
[data-theme="dark"] .sos-auth-form-box {
    background: var(--thead-bg, #18181b);
    border-color: var(--border-color, #3f3f46);
}

.sos-sso__card--staff .sos-staff-form {
    margin-top: 0.25rem;
}

.sos-sso__card--staff .sos-auth-portal-wrap {
    border-top-color: var(--border-color, #e4e4e7);
}

.sos-auth-form-box .sos-sso__google {
    margin-top: 0;
}

.sos-auth-form-box .sos-sso__hint {
    margin-top: 0.65rem;
}

.sos-auth-form-box .sos-sso__locked {
    margin: 0;
}

@media (max-height: 780px) {
    .sos-staff-form,
    .sos-auth-form-box {
        padding: 0.75rem 0.85rem 0.85rem;
    }
}


.sos-sso__hint--staff {
    margin-top: -0.25rem;
    margin-bottom: 0.15rem;
}

.sos-sso__card--staff .sos-auth-field {
    margin-bottom: 0.55rem;
}

.sos-sso__card--staff .sos-auth-portal-wrap {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-color, #e4e4e7);
}

.sos-sso__card--staff .sos-auth-submit {
    min-height: 2.65rem;
    font-size: 0.875rem;
}

.sos-sso__card--staff .sos-sso__divider {
    margin-top: 0.35rem;
}

@media (max-height: 780px) {
    .sos-auth-body--staff .sos-sso__hint--staff { display: none; }
    .sos-sso__card--staff .sos-auth-field { margin-bottom: 0.4rem; }
    .sos-sso__card--staff .sos-auth-submit { min-height: 2.4rem; }
}

/* -------------------------------------------------------------------------
   SSO demandeur - style type login-sso (Astryx), textes à gauche,
   carte centrée verticalement (zoom 100%) via .sos-sso-page
   ---------------------------------------------------------------------- */
.sos-auth-body--sso {
    /* Viewport verrouillé : pas de scroll page */
    display: block !important;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0 !important;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden !important;
}

html:has(.sos-auth-body--sso),
html:has(.sos-auth-body--sso) body {
    height: 100%;
    max-height: 100dvh;
    overflow: hidden;
}

.sos-sso-page {
    position: relative;
    z-index: 10;
    box-sizing: border-box;
    height: 100%;
    max-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1rem;
    overflow: hidden;
}

.sos-sso {
    position: relative;
    width: 100%;
    max-width: 25rem;
    margin: 0;
}

.sos-sso__card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: 0.875rem;
    padding: 1.35rem 1.35rem 1rem;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.06);
}

.sos-sso__card[hidden] {
    display: none !important;
}

.sos-sso__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.sos-sso__theme {
    position: static;
    flex-shrink: 0;
    z-index: 2;
}

.sos-sso__logo-fallback {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.5rem;
    background: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sos-sso__logo-fallback .lucide-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: #fff;
    stroke: #fff;
}

.sos-sso__logos {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 0.15rem;
    padding: 0.85rem 1rem;
    min-height: 0;
    border: 1px dashed var(--border-color, #d4d4d8);
    border-radius: 0.65rem;
    background: var(--bg-color, #fafafa);
    text-align: center;
}

[data-theme="dark"] .sos-sso__logos {
    background: var(--thead-bg, #18181b);
    border-color: var(--border-color, #3f3f46);
}

.sos-sso__estab {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    line-height: 0;
}

.sos-sso__estab-logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: clamp(4.5rem, 14vh, 7.75rem);
    object-fit: contain;
    object-position: center;
}

.sos-sso__title {
    margin: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: #dc2626;
    letter-spacing: -0.04em;
    line-height: 1.15;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.sos-sso__top .sos-sso__title {
    flex: 1;
}

.sos-sso__title-icon {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    background: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sos-sso__title-icon--logo {
    background: transparent;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    overflow: hidden;
}

.sos-sso__title-icon--logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.sos-sso__title-icon .lucide-icon {
    width: 1rem;
    height: 1rem;
    color: #fff;
    stroke: #fff;
}

.sos-sso__sub {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary, #52525b);
    line-height: 1.45;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sos-sso__sub .lucide-icon {
    width: 0.95rem;
    height: 0.95rem;
    color: #dc2626;
    flex-shrink: 0;
}

/* Bloc provider (inspiré Section muted Astryx) */
.sos-sso__provider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem 0.9rem;
    border-radius: 0.625rem;
    border: 1px solid var(--border-color, #e4e4e7);
    background: var(--thead-bg, #fafafa);
}

.sos-sso__provider-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #fef2f2;
    color: #dc2626;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sos-sso__provider-icon .lucide-icon {
    width: 1.1rem;
    height: 1.1rem;
    color: #dc2626;
}

.sos-sso__provider-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.sos-sso__provider-name {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary, #18181b);
}

.sos-sso__provider-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #71717a);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sos-sso__google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    min-height: 2.85rem;
    padding: 0.7rem 1rem;
    border-radius: 0.55rem;
    border: 1px solid #d4d4d8;
    background: #fff;
    color: #18181b;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
    transition: none;
}

.sos-sso__google:hover,
.sos-sso__google:focus-visible {
    border-color: #a1a1aa;
    background: #fff;
    color: #18181b;
    box-shadow: none;
}

.sos-sso__google svg {
    flex-shrink: 0;
}

.sos-sso__hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted, #a1a1aa);
    line-height: 1.45;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    max-width: 100%;
    width: 100%;
}

.sos-sso__hint .lucide-icon {
    width: 0.9rem;
    height: 0.9rem;
    margin-top: 0.12rem;
    color: #dc2626;
    flex-shrink: 0;
}

.sos-sso__hint-text {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    min-width: 0;
    flex: 1;
    word-break: normal;
    overflow-wrap: anywhere;
}

.sos-sso__google--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    filter: grayscale(0.35);
}

.sos-sso__locked {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    width: 100%;
    padding: 0.85rem 0.9rem;
    border-radius: 0.625rem;
    border: 1px solid #fecaca;
    background: #fef2f2;
    text-align: left;
}

.sos-sso__locked .lucide-icon {
    width: 1.15rem;
    height: 1.15rem;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.sos-sso__locked-title {
    margin: 0 0 0.2rem;
    font-size: 0.8125rem;
    font-weight: 700;
    color: #b91c1c;
}

.sos-sso__locked-text {
    margin: 0;
    font-size: 0.75rem;
    color: #7f1d1d;
    line-height: 1.45;
}

[data-theme="dark"] .sos-sso__locked {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.35);
}

[data-theme="dark"] .sos-sso__locked-title { color: #fecaca; }
[data-theme="dark"] .sos-sso__locked-text { color: #fca5a5; }

.sos-sso__card--locked {
    opacity: 0.92;
    filter: grayscale(0.2);
}

.sos-sso__divider {
    width: 100%;
    height: 0;
    border: none;
    border-top: 1px solid var(--border-color, #e4e4e7);
    margin: 0.1rem 0 0;
}

.sos-sso__mlf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
}

.sos-sso__mlf img {
    height: auto;
    width: auto;
    max-height: 2.75rem;
    max-width: min(100%, 14rem);
    object-fit: contain;
    object-position: center;
    opacity: 1;
    filter: none;
}

.sos-sso__mlf--foot {
    flex-shrink: 0;
    opacity: 0.92;
}

.sos-sso__mlf--foot img {
    max-height: 1.2rem;
    max-width: 8rem;
}

.sos-sso__foot {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
}

.sos-sso__copy {
    margin: 0;
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 650;
    color: #a1a1aa;
    text-align: right;
    white-space: nowrap;
}

[data-theme="dark"] .sos-sso__copy {
    color: #71717a;
}

/* Skeleton */
.sos-sso__skel {
    position: relative;
    z-index: 3;
    width: 100%;
    transition: opacity 0.15s ease;
}

.sos-sso__skel.is-done {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.sos-sso__skel-card {
    width: 100%;
    border: 1px solid var(--border-color, #e4e4e7);
    border-radius: 0.875rem;
    background: var(--surface-color, #fff);
    padding: 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.sos-sso__skel-pulse {
    background: linear-gradient(90deg, #f4f4f5 25%, #e4e4e7 50%, #f4f4f5 75%);
    background-size: 200% 100%;
    animation: sosSsoSkel 1.1s ease-in-out infinite;
    border-radius: 0.4rem;
}

.sos-sso__skel-logo { width: 4rem; height: 4rem; border-radius: 0.55rem; }
.sos-sso__skel-line { height: 0.7rem; border-radius: 999px; }
.sos-sso__skel-btn { width: 100%; height: 2.85rem; margin-top: 0.35rem; border-radius: 0.55rem; }

@keyframes sosSsoSkel {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

[data-theme="dark"] .sos-sso__card,
[data-theme="dark"] .sos-sso__skel-card {
    background: #18181b;
    border-color: #27272a;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .sos-sso__title { color: #ef4444; }

[data-theme="dark"] .sos-sso__google {
    background: #09090b;
    border-color: #3f3f46;
    color: #fafafa;
}

[data-theme="dark"] .sos-sso__google:hover,
[data-theme="dark"] .sos-sso__google:focus-visible {
    background: #09090b;
    border-color: #52525b;
    color: #fafafa;
}

[data-theme="dark"] .sos-sso__divider { border-color: #27272a; }


[data-theme="dark"] .sos-sso__skel-pulse {
    background: linear-gradient(90deg, #27272a 25%, #3f3f46 50%, #27272a 75%);
    background-size: 200% 100%;
}

@media (max-width: 480px) {
    .sos-sso-page { padding: 1rem 0.75rem; }
    .sos-sso__card { padding: 1.5rem 1.15rem 1.15rem; }
    .sos-sso__title { font-size: 1.5rem; }
}

@media (max-height: 780px) {
    .sos-sso-page { padding: 0.65rem 0.85rem; }
    .sos-sso__card {
        gap: 0.55rem;
        padding: 1.05rem 1.15rem 0.85rem;
    }
    .sos-sso__title { font-size: 1.45rem; }
    .sos-sso__title-icon--logo { width: 2.15rem; height: 2.15rem; }
    .sos-sso__google { min-height: 2.55rem; padding: 0.55rem 0.9rem; }
    .sos-sso__logos { padding: 0.65rem 0.85rem; }
    .sos-sso__estab-logo { max-height: clamp(4rem, 12vh, 6.25rem); }
}

@media (max-height: 640px) {
    .sos-sso-page { padding: 0.45rem 0.75rem; }
    .sos-sso__card {
        gap: 0.45rem;
        padding: 0.85rem 1rem 0.7rem;
    }
    .sos-sso__hint { display: none; }
    .sos-sso__estab-logo { max-height: clamp(3.5rem, 11vh, 5.25rem); }
    .sos-sso__mlf--foot img { max-height: 1rem; max-width: 6.5rem; }
}

@media (max-width: 480px) {
    .sos-auth-card {
        padding: 1.5rem 1.125rem 1.25rem;
    }

    .sos-auth-brand__title {
        font-size: 1.3rem;
    }

    .sos-auth-portal a {
        padding: 0.35rem 0.45rem;
        font-size: 0.68rem;
    }
}

@keyframes sos-auth-spin {
    100% { transform: rotate(360deg); }
}

/* OTP digits */
.sos-auth-otp {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0 0.75rem;
}

.sos-auth-otp input {
    width: 2.5rem;
    height: 2.75rem;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 700;
    border: 1px solid var(--border-strong, #d4d4d8);
    border-radius: 0.5rem;
    background: var(--bg-color, #fafafa);
    color: var(--text-primary, #18181b);
    outline: none;
}

.sos-auth-otp input:focus {
    border-color: #a1a1aa;
    box-shadow: none;
}

.sos-auth-otp input.filled {
    border-color: #dc2626;
    background: var(--primary-light, #fef2f2);
}

.sos-auth-strength {
    margin-top: 0.4rem;
}

.sos-auth-strength__track {
    height: 4px;
    background: var(--border-color, #e4e4e7);
    border-radius: 999px;
    overflow: hidden;
}

.sos-auth-strength__bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.2s ease, background 0.2s ease;
}

.sos-auth-strength__label {
    font-size: 0.68rem;
    font-weight: 600;
    margin-top: 0.25rem;
    text-align: right;
    color: var(--text-muted, #a1a1aa);
}

.sos-auth-submit:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* =========================================================================
   Auth - dark mode (tokens CSS, même toile que le shell)
   ========================================================================= */
[data-theme="dark"] .sos-auth-body {
    background: var(--bg-color);
    color: var(--text-primary);
}

[data-theme="dark"] .sos-auth-card__theme {
    background: transparent;
    border: none;
}

[data-theme="dark"] .sos-auth-card {
    background: var(--surface-color);
    border-color: var(--border-color);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .sos-auth-err {
    background: rgba(240, 68, 68, 0.12);
    border-color: #7f1d1d;
}

[data-theme="dark"] .sos-auth-err .lucide-icon {
    color: #f87171;
}

[data-theme="dark"] .sos-auth-portal {
    background: var(--bg-color);
}

[data-theme="dark"] .sos-auth-input,
[data-theme="dark"] .sos-auth-select,
[data-theme="dark"] .sos-auth-field-box,
[data-theme="dark"] input.sos-auth-input {
    background: var(--input-bg, var(--bg-color)) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-strong) !important;
}

[data-theme="dark"] .sos-auth-field-box:focus-within {
    border-color: var(--text-muted) !important;
}

[data-theme="dark"] .sos-auth-label {
    color: var(--text-secondary);
}

[data-theme="dark"] .sos-auth-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .sos-auth-link:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .sos-auth-foot,
[data-theme="dark"] .sos-auth-hint,
[data-theme="dark"] .sos-auth-brand__sub {
    color: var(--text-muted);
}

[data-theme="dark"] .sos-auth-ok,
[data-theme="dark"] .sos-auth-success {
    background: rgba(34, 197, 94, 0.12);
    border-color: #14532d;
    color: #bbf7d0;
}

[data-theme="dark"] .fcp-errors,
[data-theme="dark"] .auth-errors {
    background: rgba(239, 68, 68, 0.12);
    border-color: #7f1d1d;
    color: #fecaca;
}

@media (max-width: 560px) {
    .sos-auth-wrap {
        padding: 0.5rem 0.65rem;
    }

    .sos-auth-card {
        padding: 0.85rem 0.85rem 0.75rem;
        border-radius: 0.75rem;
    }

    .sos-auth-theme-fab {
        display: none !important;
    }
}

/* Portrait court / clavier mobile : carte encore plus compacte */
@media (max-height: 760px) {
    .sos-auth-body {
        align-items: flex-start;
        padding-top: 0.5rem;
    }
    .sos-auth-brand__sub { display: none; }
    .sos-auth-brand { margin-bottom: 0.45rem; }
    .sos-auth-brand__icon {
        width: 1.85rem;
        height: 1.85rem;
        margin-bottom: 0.25rem;
    }
    .sos-auth-brand__icon .lucide-icon,
    .sos-auth-brand__icon svg { width: 0.95rem; height: 0.95rem; }
    .sos-auth-brand__icon--logo { width: 3.25rem; height: 3.25rem; }
    .sos-auth-brand__title { font-size: 1.1rem; }
    .sos-auth-card { padding: 0.75rem 0.85rem 0.65rem; }
    .sos-auth-badge-row { margin-bottom: 0.45rem; }
    .sos-auth-field { margin-bottom: 0.45rem; }
    .sos-auth-portal-wrap { margin-top: 0.55rem; padding-top: 0.55rem; }
    .sos-auth-foot { margin-top: 0.55rem; }
    .sos-auth-foot__logo img { height: 12px; }
}

@media (max-height: 640px) {
    .sos-auth-foot__logo { display: none; }
    .sos-auth-portal a { font-size: 0.65rem; padding: 0.3rem 0.45rem; }
}



.sos-auth-back-wrap {
    display: flex;
    justify-content: center;
    margin-top: 0.85rem;
}
.sos-sso__back {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted, #71717a);
    text-decoration: none;
    cursor: pointer;
}
.sos-sso__back .lucide-icon,
.sos-sso__back svg {
    width: 0.95rem;
    height: 0.95rem;
    color: currentColor;
    stroke: currentColor;
}
.sos-sso__back:hover,
.sos-sso__back:focus {
    color: #dc2626;
    text-decoration: none;
}
[data-theme="dark"] .sos-sso__back {
    color: #a1a1aa;
}
[data-theme="dark"] .sos-sso__back:hover,
[data-theme="dark"] .sos-sso__back:focus {
    color: #f87171;
}


.sos-auth-submit--ghost {
    margin-top: 0.55rem;
    background: var(--surface-color, #fff);
    color: var(--text-primary, #18181b);
    border: 1px solid var(--border-color, #d4d4d8);
    box-shadow: none;
}
.sos-auth-submit--ghost:hover,
.sos-auth-submit--ghost:focus,
.sos-auth-submit--ghost:active {
    background: var(--bg-color, #fafafa);
    border-color: #a1a1aa;
    color: var(--text-primary, #18181b) !important;
}
.sos-auth-submit--ghost .lucide-icon {
    color: #dc2626;
}
a.sos-auth-submit--ghost,
a.sos-auth-submit--ghost:visited {
    color: var(--text-primary, #18181b);
    text-decoration: none;
}
a.sos-auth-submit--ghost:hover,
a.sos-auth-submit--ghost:focus,
a.sos-auth-submit--ghost:active {
    color: var(--text-primary, #18181b) !important;
    text-decoration: none;
}
a.sos-auth-submit--ghost:hover .lucide-icon,
a.sos-auth-submit--ghost:hover svg,
a.sos-auth-submit--ghost:focus .lucide-icon,
a.sos-auth-submit--ghost:focus svg {
    color: #dc2626 !important;
    stroke: #dc2626 !important;
}
/* Secondary / ghost / OTP - dark mode */
[data-theme="dark"] .sos-auth-submit--secondary {
    background: #27272a;
    color: #f87171;
    border-color: #7f1d1d;
}
[data-theme="dark"] .sos-auth-submit--secondary:hover,
[data-theme="dark"] .sos-auth-submit--secondary:focus,
[data-theme="dark"] .sos-auth-submit--secondary:active {
    background: #3f3f46;
    border-color: #991b1b;
    color: #fca5a5 !important;
}
[data-theme="dark"] a.sos-auth-submit--secondary,
[data-theme="dark"] a.sos-auth-submit--secondary:visited {
    color: #f87171;
}
[data-theme="dark"] a.sos-auth-submit--secondary:hover,
[data-theme="dark"] a.sos-auth-submit--secondary:focus,
[data-theme="dark"] a.sos-auth-submit--secondary:active {
    color: #fca5a5 !important;
}
[data-theme="dark"] a.sos-auth-submit--secondary:hover .lucide-icon,
[data-theme="dark"] a.sos-auth-submit--secondary:hover svg,
[data-theme="dark"] a.sos-auth-submit--secondary:focus .lucide-icon,
[data-theme="dark"] a.sos-auth-submit--secondary:focus svg {
    color: #fca5a5 !important;
    stroke: #fca5a5 !important;
}

[data-theme="dark"] .sos-auth-submit--ghost {
    background: #18181b;
    color: #fafafa;
    border-color: #3f3f46;
}
[data-theme="dark"] .sos-auth-submit--ghost:hover,
[data-theme="dark"] .sos-auth-submit--ghost:focus,
[data-theme="dark"] .sos-auth-submit--ghost:active {
    background: #27272a;
    border-color: #52525b;
    color: #fafafa !important;
}
[data-theme="dark"] a.sos-auth-submit--ghost,
[data-theme="dark"] a.sos-auth-submit--ghost:visited {
    color: #fafafa;
}
[data-theme="dark"] a.sos-auth-submit--ghost:hover,
[data-theme="dark"] a.sos-auth-submit--ghost:focus,
[data-theme="dark"] a.sos-auth-submit--ghost:active {
    color: #fafafa !important;
}
[data-theme="dark"] .sos-auth-submit--ghost .lucide-icon {
    color: #f87171;
}
[data-theme="dark"] a.sos-auth-submit--ghost:hover .lucide-icon,
[data-theme="dark"] a.sos-auth-submit--ghost:hover svg,
[data-theme="dark"] a.sos-auth-submit--ghost:focus .lucide-icon,
[data-theme="dark"] a.sos-auth-submit--ghost:focus svg {
    color: #fca5a5 !important;
    stroke: #fca5a5 !important;
}

[data-theme="dark"] .sos-auth-otp input {
    background: #18181b;
    border-color: #3f3f46;
    color: #fafafa;
}
[data-theme="dark"] .sos-auth-otp input:focus {
    border-color: #71717a;
}
[data-theme="dark"] .sos-auth-otp input.filled {
    background: rgba(220, 38, 38, 0.16);
    border-color: #dc2626;
    color: #fecaca;
}

/* Wordmark SOS IT sur pages auth / login */
.sos-sso__title--wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-size: inherit;
    color: #dc2626;
}
.sos-sso__title--wordmark .sos-wordmark {
    font-size: 2.45rem;
}
.sos-sso__title--wordmark .sos-wordmark__mark {
    width: 2.75rem;
    height: 2.75rem;
}
@media (max-width: 480px) {
    .sos-sso__title--wordmark .sos-wordmark { font-size: 2rem; }
    .sos-sso__title--wordmark .sos-wordmark__mark { width: 2.25rem; height: 2.25rem; }
}


/* Staff login: email/pass OR Google SSO */
.sos-auth-or {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0 0.75rem;
  color: var(--text-muted, #71717a);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sos-auth-or::before,
.sos-auth-or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color, #e4e4e7);
}
[data-theme="dark"] .sos-auth-or::before,
[data-theme="dark"] .sos-auth-or::after {
  background: #27272a;
}
.sos-sso__card--staff .sos-sso__google--staff {
  width: 100%;
  margin: 0;
}
.sos-sso__hint--staff-sso {
  margin: 0.55rem 0 0.85rem;
  font-size: 0.72rem;
  line-height: 1.35;
}
