:root {
    --background: 0 0% 100%;
    --foreground: 211 56% 18%;
    --card: 0 0% 100%;
    --card-foreground: 211 56% 18%;
    --primary: 204 87% 45%;
    --primary-strong: #0a72bc;
    --primary-soft: #edf6ff;
    --primary-foreground: 0 0% 100%;
    --secondary: 205 88% 66%;
    --secondary-soft: #e9f4ff;
    --secondary-foreground: 211 56% 18%;
    --muted: 206 44% 96%;
    --muted-foreground: 210 24% 44%;
    --accent: 214 84% 58%;
    --accent-foreground: 0 0% 100%;
    --destructive: 0 72% 51%;
    --destructive-foreground: 0 0% 100%;
    --border: 210 42% 86%;
    --input: 210 42% 86%;
    --ring: 204 87% 45%;
    --radius: 8px;
    --focus-ring: rgba(12, 132, 217, 0.18);
    --primary-gradient: linear-gradient(135deg, #13a6ea 0%, #0a72bc 100%);
    --primary-gradient-hover: linear-gradient(135deg, #0f9ce3 0%, #095f9f 100%);
    --soft-gradient: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
    --soft-gradient-hover: linear-gradient(135deg, #f7fbff 0%, #e3f0ff 100%);
    --page-gradient: linear-gradient(rgba(12, 132, 217, 0.2), rgba(10, 33, 64, 0.56)), url("../../img/maison-tresor.jpeg") center center / cover fixed no-repeat;
    --ui-font: "Segoe UI Variable", "Segoe UI", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    /* --ui-font: "raleway", "raleway", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif; */
}

[data-role="dialog"] {
    display: none;
    visibility: hidden;
}

[data-role="dialog"].modern-dialog-visible {
    display: block;
    visibility: visible;
}

.modern-centered-dialog {
    bottom: auto !important;
    left: 50% !important;
    position: fixed !important;
    right: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 90010 !important;
}

html.modern-login-page,
body.modern-login-page,
body:has(#modern-login-root) {
    background: var(--page-gradient) !important;
    color: hsl(var(--foreground));
}

body.modern-login-page #content,
body:has(#modern-login-root) #content {
    background: transparent !important;
    background-image: none !important;
    box-sizing: border-box;
    min-height: 0;
    min-width: 0;
    padding: 0 !important;
    width: min(1120px, calc(100% - 32px)) !important;
}

body.modern-login-page #content > div > table,
body.modern-login-page #content > div > table > tbody,
body.modern-login-page #content > div > table > tbody > tr,
body.modern-login-page #content > div > table > tbody > tr > td,
body:has(#modern-login-root) #content > div > table,
body:has(#modern-login-root) #content > div > table > tbody,
body:has(#modern-login-root) #content > div > table > tbody > tr,
body:has(#modern-login-root) #content > div > table > tbody > tr > td {
    box-sizing: border-box;
    display: block;
    padding: 0 !important;
    width: 100%;
}

body.modern-login-page #content td[style*="sary_tresor_small"],
body.modern-login-page #content td[style*="logofarany"],
body:has(#modern-login-root) #content td[style*="sary_tresor_small"],
body:has(#modern-login-root) #content td[style*="logofarany"] {
    background-image: none !important;
    height: auto !important;
    padding: 0 !important;
}

#modern-login-root.modern-login-shell {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    box-shadow: 0 28px 86px rgba(17, 59, 110, 0.16);
    box-sizing: border-box;
    color: hsl(var(--foreground));
    display: grid;
    -webkit-font-smoothing: antialiased;
    font-family: var(--ui-font);
    grid-template-areas: "hero panel";
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 0.95fr);
    margin: 8px auto 32px;
    min-height: 560px;
    overflow: hidden;
    position: relative;
    text-rendering: optimizeLegibility;
    transform: none;
    width: min(1120px, calc(100vw - 32px));
}

.modern-login-hero {
    background: rgba(12, 132, 217, 0.14);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    box-sizing: border-box;
    color: hsl(var(--primary-foreground));
    display: flex !important;
    flex-direction: column;
    grid-area: hero;
    justify-content: space-between;
    min-height: 560px;
    overflow: hidden;
    padding: 40px;
    position: relative;
}

.modern-login-hero-bg {
    background-image:
        linear-gradient(135deg, rgba(12, 132, 217, 0.12), rgba(70, 157, 232, 0.18)),
        url("../../img/login-digital-globe.svg");
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    inset: 0;
    opacity: 0.96;
    position: absolute;
}

.modern-login-hero::after {
    background: linear-gradient(180deg, rgba(9, 70, 148, 0.08), rgba(10, 33, 64, 0.2));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.modern-login-hero-content,
.modern-login-hero-footer {
    position: relative;
    z-index: 1;
}

.modern-login-badge {
    align-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(211, 234, 255, 0.28);
    border-radius: 8px;
    box-sizing: border-box;
    display: inline-flex;
    gap: 12px;
    padding: 8px 16px;
}

.modern-login-badge-mobile {
    background: hsl(var(--muted));
    border-color: hsl(var(--border));
    color: hsl(var(--muted-foreground));
}

.modern-login-dot {
    background: hsl(var(--secondary));
    border-radius: 999px;
    display: inline-block;
    height: 8px;
    width: 8px;
}

.modern-login-copy {
    margin-top: 40px;
    max-width: 448px;
}

.modern-login-kicker {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    margin: 0;
    text-transform: uppercase;
}

.modern-login-kicker-logo {
    align-items: center;
    display: inline-flex;
    letter-spacing: 0;
}

.modern-login-kicker-logo img {
    display: block;
    height: 34px;
    max-width: 180px;
    object-fit: contain;
    width: auto;
}

.modern-login-title {
    color: #ffffff;
    font-size: 35px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.18;
    margin: 12px 0 0;
}

.modern-login-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    line-height: 1.65;
    margin: 20px 0 0;
}

.modern-login-hero-footer {
    align-items: flex-end;
    display: flex;
    gap: 32px;
    justify-content: space-between;
}

.modern-login-note {
    border-left: 1px solid rgba(211, 234, 255, 0.28);
    box-sizing: border-box;
    max-width: 280px;
    padding-left: 20px;
}

.modern-login-note p {
    margin: 0;
}

.modern-login-note p:first-child {
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
}

.modern-login-note p:last-child {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1.65;
    margin-top: 8px;
}

.modern-login-panel {
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-sizing: border-box;
    display: flex;
    grid-area: panel;
    min-height: 560px;
    padding: 40px;
}

.modern-login-form-wrap {
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 420px;
    width: 100%;
}

.modern-login-mobile-copy {
    display: none;
}

.modern-login-brand {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 28px;
}

.modern-login-brand p {
    margin: 0;
}

.modern-login-brand p:first-child {
    color: hsl(var(--foreground));
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.modern-login-brand p:last-child {
    color: hsl(var(--muted-foreground));
    font-size: 13px;
    line-height: 1.5;
    margin-top: 2px;
}

.modern-login-logo {
    height: 68px;
    max-width: 108px;
    object-fit: contain;
    width: auto;
}

#LOGIN_FORM {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#from_recup_compte {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modern-field {
    display: block;
}

.modern-field-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.modern-field-head label {
    margin-bottom: 0 !important;
}

#LOGIN_FORM label,
#from_recup_compte label {
    color: hsl(var(--foreground));
    display: block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}

.modern-field-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

#LOGIN_FORM a,
#from_recup_compte a {
    color: var(--primary-strong);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

#LOGIN_FORM a:hover,
#from_recup_compte a:hover {
    text-decoration: underline;
}

#LOGIN_FORM input[type="text"],
#LOGIN_FORM input[type="password"],
#from_recup_compte input[type="text"] {
    background: hsl(var(--background));
    border: 1px solid hsl(var(--input));
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(12, 62, 116, 0.05);
    box-sizing: border-box;
    color: hsl(var(--foreground));
    display: block;
    font-size: 13px;
    height: 44px;
    outline: none;
    padding: 0 12px;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    width: 100%;
}

#from_recup_compte input[type="text"] {
    height: 40px;
}

#LOGIN_FORM input[type="text"]:focus,
#LOGIN_FORM input[type="password"]:focus,
#from_recup_compte input[type="text"]:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.modern-captcha {
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    box-sizing: border-box;
    padding: 12px;
}

#login_submit,
#from_recup_compte button {
    align-items: center;
    background: var(--primary-gradient);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 10px 22px rgba(12, 132, 217, 0.18);
    box-sizing: border-box;
    color: hsl(var(--primary-foreground));
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.01em;
    height: 44px;
    justify-content: center;
    padding: 0 16px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
    width: 100%;
}

#from_recup_compte button {
    height: 40px;
}

#login_submit:hover,
#from_recup_compte button:hover {
    background: var(--primary-gradient-hover);
    box-shadow: 0 14px 28px rgba(10, 114, 188, 0.24);
    transform: translateY(-1px);
}

#login_submit:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.modern-login-links {
    border-top: 1px solid hsl(var(--border));
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding-top: 20px;
}

.modern-login-support {
    color: hsl(var(--muted-foreground));
    font-size: 12px;
    line-height: 1.6;
    margin: 20px 0 0;
    text-align: center;
}

.modern-login-support a {
    color: var(--primary-strong);
    font-weight: 700;
    text-decoration: none;
}

.modern-login-support a:hover {
    text-decoration: underline;
}

.modern-recovery-content {
    background: hsl(var(--background));
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(10, 33, 64, 0.22);
    box-sizing: border-box;
    color: hsl(var(--foreground));
    padding: 24px;
}

.modern-recovery-head {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modern-recovery-head-main {
    flex: 1 1 auto;
    min-width: 0;
}

.modern-recovery-head p {
    margin: 0;
}

.modern-recovery-head p:first-child {
    color: hsl(var(--foreground));
    font-size: 18px;
    font-weight: 700;
}

.modern-recovery-head p:last-child {
    color: hsl(var(--muted-foreground));
    font-size: 14px;
    line-height: 1.5;
    margin-top: 4px;
}

.modern-recovery-status {
    margin-bottom: 12px;
}

.modern-recovery-status:empty {
    display: none;
}

.modern-recovery-alert {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 14px;
    color: #9a3412;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    padding: 11px 12px;
}

.modern-recovery-close {
    align-items: center;
    align-self: flex-start;
    background: var(--soft-gradient);
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    color: hsl(var(--primary));
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    min-width: 92px;
    padding: 0 14px;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.modern-recovery-close:hover {
    background: var(--soft-gradient-hover);
    border-color: hsl(var(--primary));
}

.modern-recovery-close:focus {
    border-color: hsl(var(--primary));
    box-shadow: 0 0 0 3px var(--focus-ring);
    outline: none;
}

html.modern-login-page,
body.modern-login-page {
    background: var(--page-gradient) !important;
    color: hsl(var(--foreground));
    min-height: 100vh;
    overflow-x: hidden;
}

html.modern-login-page {
    background-attachment: fixed !important;
}

body.modern-login-page #header {
    height: 96px;
    min-width: 0;
    width: min(1120px, calc(100% - 32px)) !important;
}

body.modern-login-page #header table {
    height: 96px;
}

body.modern-login-page #header img {
    height: 88px;
    max-height: 88px;
    max-width: 100px;
    object-fit: contain;
    width: auto;
}

body.modern-login-page #header a {
    left: 0 !important;
    top: 8px !important;
}

body.modern-login-page #header td:first-child > div {
    color: #ffffff !important;
    padding-left: 112px !important;
    padding-top: 30px !important;
}

body.modern-login-page #content {
    background: transparent !important;
    background-image: none !important;
    box-sizing: border-box;
    margin-top: 8px;
    min-height: 0;
    min-width: 0;
    padding: 0;
    width: min(1120px, calc(100% - 32px)) !important;
}

body.modern-login-page #content > div > table,
body.modern-login-page #content > div > table > tbody,
body.modern-login-page #content > div > table > tbody > tr,
body.modern-login-page #content > div > table > tbody > tr > td {
    box-sizing: border-box;
    display: block;
    padding: 0 !important;
    width: 100%;
}

body.modern-login-page #content td[style*="sary_tresor_small"],
body.modern-login-page #content td[style*="logofarany"] {
    background-image: none !important;
    height: auto !important;
    padding: 0 !important;
}

body.modern-login-page #modern-login-root {
    font-family: var(--ui-font);
}

body.modern-login-page #content_div {
    width: 100%;
}

body.modern-login-page #return_error {
    min-height: 0;
}

body.modern-login-page #return_error .notify,
body.modern-login-page #return_error > span {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    box-sizing: border-box;
    color: #7c2d12;
    display: block;
    margin: 0 0 16px;
    padding: 12px 14px;
    width: 100%;
}

body.modern-login-page #return_error .notify-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 4px;
}

body.modern-login-page #return_error .notify-text {
    display: block;
    font-size: 13px;
    line-height: 1.45;
}

body.modern-login-page .modern-captcha cap-widget {
    display: block;
    width: 100%;
}

body.modern-login-page .modern-captcha > div[onclick] {
    display: none;
}

body.modern-login-page .dialog-overlay,
html.modern-login-page .dialog-overlay {
    background: rgba(10, 33, 64, 0.56) !important;
    inset: 0 !important;
    position: fixed !important;
    z-index: 90000 !important;
}

body.modern-login-page .modern-recovery-dialog {
    background: transparent !important;
    border: 0 !important;
    border-radius: 8px;
    box-shadow: none !important;
    max-height: calc(100vh - 32px) !important;
    max-width: min(440px, calc(100vw - 32px));
    overflow: visible !important;
    pointer-events: auto !important;
    width: min(440px, calc(100vw - 32px)) !important;
    z-index: 90010 !important;
}

body.modern-login-page .modern-recovery-dialog input {
    box-sizing: border-box;
}

body.modern-login-page .modern-recovery-dialog.modern-dialog-visible {
    bottom: auto !important;
    display: block !important;
    left: 50% !important;
    position: fixed !important;
    right: auto !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    visibility: visible !important;
}

body.modern-login-page .presenter {
    display: none;
}

@media (max-width: 1024px) {
    .modern-recovery-head {
        align-items: stretch;
        flex-direction: column;
    }

    .modern-recovery-close {
        width: 100%;
    }

    #modern-login-root.modern-login-shell {
        display: block;
        margin-left: auto;
        margin-right: auto;
        min-height: 0;
        width: 100%;
    }

    .modern-login-hero {
        display: none !important;
    }

    .modern-login-panel {
        min-height: 0;
        padding: 28px;
    }

    .modern-login-mobile-copy {
        display: block;
        margin-bottom: 32px;
        text-align: center;
    }

.modern-login-mobile-copy h1 {
        color: hsl(var(--foreground));
        font-size: 28px;
        font-weight: 800;
        letter-spacing: -0.02em;
        line-height: 1.18;
        margin: 20px 0 0;
    }

    .modern-login-mobile-copy p {
        color: hsl(var(--muted-foreground));
        font-size: 13px;
        line-height: 1.55;
        margin: 12px 0 0;
    }

    .modern-login-brand {
        flex-direction: column;
        text-align: center;
    }

    #LOGIN_FORM > a {
        text-align: center;
    }

    .modern-login-links {
        align-items: center;
        flex-direction: column;
        text-align: center;
    }

    body.modern-login-page #header {
        height: 82px;
        width: min(100% - 24px, 1120px) !important;
    }

    body.modern-login-page #header a {
        top: 8px !important;
    }

    body.modern-login-page #header img {
        height: 68px;
        max-height: 68px;
        max-width: 78px;
    }

    body.modern-login-page #header td:first-child > div {
        font-size: 13px !important;
        padding-left: 88px !important;
        padding-top: 22px !important;
    }

    body.modern-login-page #header td:first-child > div > div {
        display: none;
    }

    body.modern-login-page #content {
        width: min(100% - 24px, 1120px) !important;
    }
}

@media (min-width: 561px) and (max-width: 1024px) {
    #modern-login-root.modern-login-shell {
        width: min(760px, calc(100vw - 40px));
    }

    body.modern-login-page #header,
    body.modern-login-page #content {
        width: min(760px, calc(100% - 40px)) !important;
    }
}
