/* Identity — layout auth uniquement (thème dans ThemeModern.css via body.theme-modern) */

/* Alias tokens Identity → Theme */
body.theme-modern {
    --identity-accent: var(--theme-accent);
    --identity-accent-soft: var(--theme-accent-soft);
    --identity-surface: var(--theme-surface);
    --identity-surface-border: var(--theme-surface-border);
}

/* Auth chrome (layouts WithoutHeader : theme-auth) */
body.theme-modern.theme-auth .RoundedImage,
body.theme-modern.theme-auth .logyline-logo,
body.theme-modern.theme-auth img.RoundedImage,
body.theme-modern.theme-auth img.logyline-logo {
    height: 120px !important;
    width: 120px !important;
    max-height: 120px;
    filter: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    border: none !important;
}

body.theme-modern.theme-auth .divCenter.mb-4 {
    margin-bottom: 0.5rem !important;
}

/* Handshake Connect → service (login OIDC) */
body.theme-modern.theme-auth .auth-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

body.theme-modern.theme-auth .auth-brand-handshake {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

body.theme-modern.theme-auth .auth-brand-handshake .logyline-logo,
body.theme-modern.theme-auth .auth-brand-handshake img.logyline-logo {
    height: 96px !important;
    width: 96px !important;
    max-height: 96px;
}

body.theme-modern.theme-auth .auth-brand-logo--service {
    height: 96px;
    width: 96px;
    max-height: 96px;
    max-width: 96px;
    object-fit: contain;
}

body.theme-modern.theme-auth .auth-brand-arrow {
    font-size: 1.25rem;
    line-height: 1;
    color: color-mix(in srgb, var(--textbrush) 45%, transparent);
    user-select: none;
}

body.theme-modern.theme-auth .auth-brand-caption {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.35;
    color: color-mix(in srgb, var(--textbrush) 72%, transparent);
}

body.theme-modern.theme-auth .top-right-absolute.topright,
body.theme-modern.theme-auth .topright {
    top: 1rem;
    right: 1rem;
    left: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primarybrush) 72%, transparent);
    border: 1px solid var(--theme-surface-border);
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 45%, transparent) inset,
        0 10px 28px rgba(15, 40, 45, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 20;
}

body.theme-modern.theme-auth .languageSelection {
    width: auto;
    margin: 0;
    position: relative;
}

body.theme-modern.theme-auth #DropdownDisplayer {
    height: 42px;
    width: 42px;
    margin: 0;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--secondarybrush) 70%, transparent);
    border-radius: 50%;
    background: color-mix(in srgb, var(--primarybrush) 65%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: none;
    -ms-transform: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.15s ease, background 0.18s ease;
}

body.theme-modern.theme-auth #DropdownDisplayer:hover,
body.theme-modern.theme-auth #DropdownDisplayer:focus {
    background: color-mix(in srgb, var(--primarybrush) 88%, transparent);
    border-color: var(--tertiarylightbrush);
    box-shadow: 0 0 0 3px var(--theme-accent-soft);
    transform: none;
}

body.theme-modern.theme-auth #DropdownDisplayer .language-imgFront,
body.theme-modern.theme-auth #DropdownDisplayer svg,
body.theme-modern.theme-auth #DropdownDisplayer img {
    width: 22px !important;
    height: 16px !important;
    max-width: 22px;
    max-height: 16px;
    transform: none !important;
    display: block;
    border-radius: 3px;
    overflow: hidden;
    object-fit: cover;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondarybrush) 55%, transparent);
}

body.theme-modern.theme-auth .languageSelection .dropdown-menu {
    min-width: 12.5rem !important;
    margin-top: 0.55rem !important;
    padding: 0.4rem;
    left: auto !important;
    right: 0 !important;
    border-radius: 14px;
    border: 1px solid var(--theme-surface-border);
    background: color-mix(in srgb, var(--primarybrush) 88%, transparent);
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 40%, transparent) inset,
        0 16px 36px rgba(15, 40, 45, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

body.theme-modern.theme-auth .languageSelection .dropdown-link.flag-link,
body.theme-modern.theme-auth .languageSelection .flag-link {
    width: 100%;
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.65rem;
    color: var(--textbrush) !important;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

body.theme-modern.theme-auth .languageSelection .dropdown-link.flag-link:hover,
body.theme-modern.theme-auth .languageSelection .flag-link:hover {
    background: color-mix(in srgb, var(--tertiarylightbrush) 16%, transparent);
    color: color-mix(in srgb, var(--tertiarylightbrush) 45%, var(--textbrush)) !important;
}

body.theme-modern.theme-auth .languageSelection .language-img {
    width: 24px;
    max-height: none;
    margin: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

body.theme-modern.theme-auth .languageSelection .language-img svg,
body.theme-modern.theme-auth .languageSelection .language-img img {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    display: block;
    object-fit: cover;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--secondarybrush) 50%, transparent);
}

body.theme-modern.theme-auth .languageSelection droptxt {
    font-size: var(--fontsizesubcontent);
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

body.theme-modern.theme-auth .buttonRightBar {
    height: 42px;
    width: 42px;
    margin: 0;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primarybrush) 65%, transparent);
    color: var(--textbrush);
    border: 1px solid color-mix(in srgb, var(--secondarybrush) 70%, transparent);
    border-radius: 50%;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.15s ease;
}

body.theme-modern.theme-auth .buttonRightBar:hover,
body.theme-modern.theme-auth .buttonRightBar:focus {
    height: 42px;
    width: 42px;
    margin: 0;
    background: color-mix(in srgb, var(--primarybrush) 88%, transparent);
    color: var(--tertiarylightbrush);
    border-color: var(--tertiarylightbrush);
    box-shadow: 0 0 0 3px var(--theme-accent-soft);
    transform: translateY(-1px);
}

body.theme-modern.theme-auth .buttonRightBar:active {
    transform: translateY(0);
}

body.theme-modern.theme-auth .theme-toggle {
    color: color-mix(in srgb, var(--tertiarylightbrush) 55%, var(--textbrush));
}

body.theme-modern.theme-auth .theme-toggle.is-dark {
    color: color-mix(in srgb, var(--tertiarybrush) 70%, #fff);
}

body.theme-modern.theme-auth .theme-toggle__icons {
    width: 1.4rem;
    height: 1.4rem;
}

body.theme-modern.theme-auth .theme-toggle:hover {
    color: var(--tertiarylightbrush);
}

/* Carte auth */
.identity-page {
    width: 100%;
    max-width: 400px;
    margin: 1rem auto 2.5rem;
    padding: 2.15rem 1.85rem;
    box-sizing: border-box;
    background: color-mix(in srgb, var(--primarybrush) 78%, transparent);
    border: 1px solid var(--theme-surface-border, color-mix(in srgb, var(--secondarybrush) 55%, transparent));
    border-radius: 20px;
    box-shadow:
        0 1px 0 color-mix(in srgb, #fff 55%, transparent) inset,
        0 18px 48px rgba(15, 40, 45, 0.08),
        0 4px 12px rgba(15, 40, 45, 0.04);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    position: relative;
}

.identity-page::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    border-radius: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--tertiarybrush) 70%, transparent),
        transparent
    );
    pointer-events: none;
}

.identity-page--wide {
    max-width: 720px;
}

.identity-page--manage {
    max-width: 960px;
    margin-top: 1rem;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--primarybrush);
}

.identity-page h1,
.identity-page h2,
.identity-page h3,
.identity-page h4,
.identity-page .subtitle,
.identity-page .title {
    color: var(--textbrush);
    font-size: var(--fontsizesubTitle);
    font-weight: 600;
    margin: 0 0 1.35rem;
    line-height: 1.3;
    text-align: center;
    letter-spacing: -0.02em;
}

.identity-page h2 {
    font-size: var(--fontsizetitle);
    font-weight: 600;
}

.identity-page h4.identity-section-title,
.identity-page .identity-section-title {
    font-size: var(--fontsizecontent);
    font-weight: 500;
    margin: 1.25rem 0 0.5rem;
    text-align: center;
    opacity: 0.75;
}

.identity-page hr,
.identity-page .identity-divider {
    border: none;
    border-top: 1px solid var(--secondarybrush);
    margin: 1.5rem 0 1.25rem;
    opacity: 0.45;
    width: 100%;
}

.identity-page p {
    color: var(--textbrush);
    font-size: var(--fontsizecontent);
    line-height: 1.55;
    margin-bottom: 1rem;
}

.identity-page .labelTextForm,
.identity-page .LoginTextForm,
.identity-page .labelFormLogin,
.identity-page .labelText,
.identity-page label {
    color: var(--textbrush);
    font-size: var(--fontsizesubcontent);
    font-weight: 500;
    margin-bottom: 0.45rem;
    letter-spacing: 0.01em;
    text-transform: none;
}

.identity-page .textBoxActive,
.identity-page .mobileInput,
.identity-page .fieldTextBoxPwd,
.identity-page .inputTextBox,
.identity-page .form-control,
.identity-page input[type="email"],
.identity-page input[type="password"],
.identity-page input[type="text"],
.identity-page input[type="tel"],
.identity-page select {
    max-width: 100%;
    min-height: 2.85rem;
    padding: 0.75rem 1rem;
    font-size: var(--fontsizecontent);
}

.identity-page:not(.identity-page--wide):not(.identity-page--manage) .textBoxActive,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) .mobileInput,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) .fieldTextBoxPwd,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) .inputTextBox,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) .form-control,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) input[type="email"],
.identity-page:not(.identity-page--wide):not(.identity-page--manage) input[type="password"],
.identity-page:not(.identity-page--wide):not(.identity-page--manage) input[type="text"],
.identity-page:not(.identity-page--wide):not(.identity-page--manage) input[type="tel"],
.identity-page:not(.identity-page--wide):not(.identity-page--manage) select {
    width: 100%;
}

.identity-page .form-group {
    margin-bottom: 1rem;
    width: 100%;
}

.identity-page .ButtonPrimary,
.identity-page .ButtonSecondary,
.identity-page .ButtonDelete {
    min-width: 180px;
    margin-top: 0.35rem;
}

.identity-page .btn-link {
    color: color-mix(in srgb, var(--tertiarylightbrush) 62%, #000);
    font-size: var(--fontsizesubcontent);
    font-weight: 500;
}

.identity-page .identity-secondary-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0;
    padding-top: 0;
    width: 100%;
}

.identity-page .identity-secondary-links::before {
    content: "";
    display: block;
    width: 100%;
    border-top: 1px solid var(--secondarybrush);
    opacity: 0.4;
    margin-bottom: 0.35rem;
}

/* Liens secondaires : texte, pas de cadre bouton au hover */
.identity-page .identity-link,
.identity-page a.identity-link,
.identity-page .linkPassword {
    color: color-mix(in srgb, var(--tertiarylightbrush) 62%, #000);
    font-size: var(--fontsizesubcontent);
    font-weight: 500;
    text-decoration: none;
    background: none;
    border: none;
    padding: 0.35rem 0.5rem;
    line-height: 1.4;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}

.identity-page .identity-link:hover,
.identity-page a.identity-link:hover,
.identity-page .linkPassword:hover {
    text-decoration: underline;
    color: color-mix(in srgb, var(--tertiarylightbrush) 45%, #000);
    background: color-mix(in srgb, var(--tertiarylightbrush) 8%, transparent);
    border: none;
}

.identity-page .identity-link--muted,
.identity-page a.identity-link--muted {
    color: var(--textbrush);
    opacity: 0.55;
    font-weight: 400;
    font-size: calc(var(--fontsizesubcontent) * 0.95);
}

.identity-page .identity-link--muted:hover,
.identity-page a.identity-link--muted:hover {
    color: var(--textbrush);
    opacity: 0.8;
    background: transparent;
}

.identity-page .identity-muted {
    color: var(--textbrush);
    font-size: var(--fontsizesubcontent);
    opacity: 0.7;
    text-align: center;
    margin: 0;
}

.identity-page:not(.identity-page--wide):not(.identity-page--manage) form {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.identity-page:not(.identity-page--wide):not(.identity-page--manage) form .form-group {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.identity-page:not(.identity-page--wide):not(.identity-page--manage) form .form-group .labelTextForm,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) form .form-group .labelFormLogin {
    text-align: left;
    align-self: flex-start;
}

.identity-page:not(.identity-page--wide):not(.identity-page--manage) form .text-center,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) form > .text-danger,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) form > hr,
.identity-page:not(.identity-page--wide):not(.identity-page--manage) form > h4 {
    width: 100%;
}

.identity-field {
    margin: 0 0 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
}

.identity-field .labelFormLogin,
.identity-field .labelTextForm {
    align-self: flex-start;
}

.identity-pwd-row,
.identity-page .divPwd,
.identity-page .divPwdButton {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    width: 100%;
}

.identity-page .DisplayMessage,
.identity-message {
    display: flex;
    justify-content: center;
    align-items: center;
    background: color-mix(in srgb, var(--tertiarylightbrush) 12%, var(--primarybrush));
    border: 1px solid color-mix(in srgb, var(--tertiarylightbrush) 28%, transparent);
    border-radius: 12px;
    padding: 0.85rem 1rem;
    margin: 0 auto 1rem;
    max-width: 400px;
    color: var(--textbrush);
}

.identity-page .DisplayMessage {
    max-width: 100%;
}

.identity-manage-nav {
    margin-bottom: 1rem;
}

.identity-manage-nav .nav-pills .nav-link {
    color: var(--textbrush);
    border-radius: 8px;
}

.identity-manage-nav .nav-pills .nav-link.active {
    background: var(--tertiarylightbrush);
    color: var(--colorLight);
}

.identity-page--manage > h2,
.identity-page--manage > .identity-section-title {
    text-align: center;
}

.identity-page--manage .col-md-9 h2,
.identity-page--manage .col-md-9 h4,
.identity-page--manage .col-md-9 h5 {
    text-align: left;
}

.identity-page--manage .col-md-9 .ButtonPrimary,
.identity-page--manage .col-md-9 .ButtonSecondary,
.identity-page--manage .col-md-9 .ButtonDelete {
    width: auto;
    min-width: 140px;
}

@media (max-width: 768px) {
    body.theme-modern.theme-auth .RoundedImage,
    body.theme-modern.theme-auth .logyline-logo,
    body.theme-modern.theme-auth img.RoundedImage {
        height: 88px !important;
        width: 88px !important;
        max-height: 88px;
    }

    body.theme-modern.theme-auth .auth-brand-handshake .logyline-logo,
    body.theme-modern.theme-auth .auth-brand-handshake img.logyline-logo,
    body.theme-modern.theme-auth .auth-brand-logo--service {
        height: 72px !important;
        width: 72px !important;
        max-height: 72px;
        max-width: 72px;
    }

    body.theme-modern.theme-auth .auth-brand-handshake {
        gap: 0.5rem;
    }

    body.theme-modern.theme-auth .top-right-absolute.topright,
    body.theme-modern.theme-auth .topright {
        top: 0.65rem;
        right: 0.65rem;
        padding: 0.28rem;
        gap: 0.25rem;
    }

    body.theme-modern.theme-auth #DropdownDisplayer,
    body.theme-modern.theme-auth .buttonRightBar,
    body.theme-modern.theme-auth .buttonRightBar:hover,
    body.theme-modern.theme-auth .buttonRightBar:focus {
        height: 38px;
        width: 38px;
    }

    .identity-page {
        margin: 0.75rem 0.75rem 1.5rem;
        padding: 1.5rem 1.15rem;
        border-radius: 16px;
    }

    .identity-page .col-md-3,
    .identity-page .col-sm-8,
    .identity-page .col-sm-6,
    .identity-page .col-md-8,
    .identity-page .col-md-6,
    .identity-page .col-md-4,
    .identity-page .col-form-label {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
        text-align: left !important;
        padding-left: 0;
        padding-right: 0;
    }

    .identity-page .form-group.row {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        max-width: 100%;
    }

    .identity-page .ButtonPrimary,
    .identity-page .ButtonSecondary {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .identity-page h1,
    .identity-page h2,
    .identity-page h3,
    .identity-page h4,
    .identity-page .subtitle,
    .identity-page .title {
        font-size: var(--fontsizecontent);
    }
}

@media (prefers-reduced-motion: reduce) {
    body.theme-modern.theme-auth #DropdownDisplayer,
    body.theme-modern.theme-auth .buttonRightBar,
    body.theme-modern.theme-auth .languageSelection .flag-link,
    .identity-page .identity-link,
    .identity-page .linkPassword {
        transition: none;
    }

    body.theme-modern.theme-auth .buttonRightBar:hover {
        transform: none;
    }
}
