/* Login-only styles: keep the rest of the plain-page layout independent. */
.login-page {
    --auth-bg: #f8f7f3;
    --auth-panel: #ffffff;
    --auth-field: #ffffff;
    --auth-text: #171511;
    --auth-muted: #6e685c;
    --auth-border: rgba(185, 154, 54, .34);
    --auth-gold: #d4af37;
    --auth-link: #8a6b19;
    --auth-hover: #f5efdc;
    --auth-error: #a83228;
    --auth-card-shadow: 0 18px 46px rgba(30, 25, 12, .08);
    --auth-menu-shadow: 0 16px 34px rgba(30, 25, 12, .12);
    --auth-control-height: 52px;
    --auth-page-padding-y: 20px;
    --auth-page-padding-x: 20px;
    background: var(--auth-bg) !important;
    color: var(--auth-text) !important;
    font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
    color-scheme: light;
}
html.theme-dark .login-page {
    --auth-bg: #050505;
    --auth-panel: #101010;
    --auth-field: #171717;
    --auth-text: #f5f1e7;
    --auth-muted: #b8ad91;
    --auth-border: rgba(212, 175, 55, .32);
    --auth-link: #e1c565;
    --auth-hover: #211c10;
    --auth-error: #ffb3ab;
    --auth-card-shadow: 0 22px 70px rgba(0, 0, 0, .42);
    --auth-menu-shadow: 0 18px 42px rgba(0, 0, 0, .42);
    color-scheme: dark;
}
.login-page [hidden] { display: none !important; }
.login-page #container.cls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: var(--auth-page-padding-y) var(--auth-page-padding-x);
    background: var(--auth-bg) !important;
}
.login-page #bg-overlay { display: none; }
.login-page #container > .cls-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 2 * var(--auth-page-padding-y));
    min-height: calc(100svh - 2 * var(--auth-page-padding-y));
    padding: 0;
    margin: 0;
    background: transparent;
    color: var(--auth-text);
}
.login-page .auth-shell { flex: 0 0 auto; width: 100%; max-width: 486px; margin: auto; }
.login-page .auth-card {
    width: 100%;
    margin: 0;
    padding: 30px 34px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-panel);
    color: var(--auth-text);
    box-shadow: var(--auth-card-shadow);
}
html:not(.theme-dark) .login-page .auth-card {
    border: 1px solid rgba(212, 175, 55, .36);
}
.login-page .auth-header { margin-bottom: 24px; text-align: center; }
.login-page .auth-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    background: #000;
}
.login-page .auth-brand img { display: block; max-width: 100%; width: 268px; height: auto; }
.login-page .auth-eyebrow {
    display: block;
    margin-top: 15px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    color: var(--auth-link);
    text-align: center;
}
.login-page .auth-header h1 {
    margin: 0;
    font-size: 1px;
    line-height: 1.4;
    font-weight: 600;
    color: var(--auth-text);
}
.login-page .auth-form { text-align: left; }
.login-page .form-group { margin: 0 0 14px; }
.login-page .form-group > label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-text);
}
.login-page .form-control,
.login-page .btn {
    min-height: var(--auth-control-height);
    border-radius: 8px;
    font-size: 16px;
    line-height: 24px;
    box-shadow: none;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.login-page .form-control {
    height: var(--auth-control-height);
    padding: 13px 14px;
    background: var(--auth-field) !important;
    color: var(--auth-text) !important;
    border: 1px solid var(--auth-border) !important;
}
.login-page .form-control::placeholder { color: var(--auth-muted) !important; opacity: 1; }
.login-page input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-field) inset !important;
    caret-color: var(--auth-text);
}
.login-page .btn.auth-primary,
.login-page #btnSignIn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 13px 18px;
    background: var(--auth-gold) !important;
    border: 1px solid var(--auth-gold) !important;
    color: #111 !important;
    font-weight: 700;
    text-shadow: none !important;
}
.login-page .btn.auth-primary:hover,
.login-page #btnSignIn:hover { background: #e4c45b !important; border-color: #e4c45b !important; }
.login-page .btn.auth-secondary,
.login-page .bootstrap-select > .dropdown-toggle {
    padding: 13px 14px;
    background: var(--auth-field) !important;
    border: 1px solid var(--auth-border) !important;
    color: var(--auth-text) !important;
    text-shadow: none !important;
}
.login-page .btn.auth-secondary:hover,
.login-page .bootstrap-select > .dropdown-toggle:hover { border-color: var(--auth-gold) !important; }
.login-page .btn:focus,
.login-page a:focus,
.login-page .bootstrap-select > .dropdown-toggle:focus {
    outline: 2px solid var(--auth-gold) !important;
    outline-offset: 3px;
    box-shadow: none !important;
}
.login-page .form-control:focus {
    border-color: var(--auth-gold) !important;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, .18) !important;
}
html:not(.theme-dark) .login-page .btn,
html:not(.theme-dark) .login-page .form-control:focus { box-shadow: none !important; }
.login-page .btn:disabled { opacity: .55; cursor: not-allowed; }
.login-page .btn.is-loading:disabled { opacity: 1; cursor: progress; }
.login-page .auth-button-spinner {
    display: inline-block;
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(17, 17, 17, .25);
    border-top-color: #111;
    border-radius: 50%;
    animation: auth-button-spin .8s linear infinite;
}
@keyframes auth-button-spin { to { transform: rotate(360deg); } }
.login-page .g-recaptcha { display: flex; justify-content: center; margin: 2px 0 20px; min-height: 78px; }
.login-page .auth-forgot {
    display: table;
    width: auto;
    min-height: auto;
    margin: 12px auto 0;
    padding: 0 2px 2px;
    border-bottom: 1px solid transparent;
    color: var(--auth-muted);
    text-align: center;
    font-size: 13px;
    line-height: 18px;
    text-decoration: none;
    white-space: normal;
}
.login-page .auth-forgot:hover,
.login-page .auth-forgot:focus {
    color: var(--auth-link);
    border-bottom-color: var(--auth-gold);
    text-decoration: none;
}
.login-page .auth-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
}
.login-page .auth-language { min-width: 0; }
.login-page #login-language { display: flex; align-items: center; gap: 12px; text-align: left; }
.login-page .auth-language-label { flex: 1; min-width: 0; font-size: 12px; line-height: 16px; color: var(--auth-muted); }
.login-page .auth-language-current { flex: 1; min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; line-height: 18px; color: var(--auth-text); }
.login-page #login-language { padding-top: 7px; padding-bottom: 7px; height: 46px; min-height: 46px; }
.login-page .auth-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 94px;
    height: 46px;
    min-height: 46px;
    padding: 0 14px;
    color: var(--auth-link) !important;
    background: var(--auth-field) !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-shadow: none !important;
}
.login-page .auth-theme-toggle i { width: 14px; text-align: center; font-size: 14px; }
.login-page .auth-theme-label { line-height: 16px; }
.login-page .auth-theme-toggle:hover {
    border-color: var(--auth-gold) !important;
    background: var(--auth-hover) !important;
}
.login-page .auth-shell a { color: var(--auth-link); }
.login-page .auth-shell a:hover,
.login-page .auth-shell a:focus { color: var(--auth-link); text-decoration: underline; }
.login-page .auth-footer { display: grid; gap: 5px; margin-top: 24px; text-align: center; color: var(--auth-muted); font-size: 10px; letter-spacing: .04em; line-height: 1.6; }
.login-page .auth-footer strong { color: var(--auth-text); font-weight: 600; }

/* bootstrap-select draws a button; sizing the original select alone has no effect. */
.login-page .bootstrap-select.form-control {
    display: block;
    width: 100% !important;
    height: var(--auth-control-height);
    padding: 0;
    background: transparent !important;
    border: 0 !important;
}
.login-page .bootstrap-select > .dropdown-toggle {
    width: 100%;
    height: var(--auth-control-height);
    padding-right: 36px;
}
.login-page .bootstrap-select .filter-option { text-overflow: ellipsis; line-height: 24px; }
.login-page .dropdown-menu {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    padding: 6px;
    margin-top: 8px;
    background: var(--auth-panel);
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    box-shadow: var(--auth-menu-shadow);
    color: var(--auth-text);
}
.login-page .dropdown-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border-radius: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    color: var(--auth-text);
    font-size: 14px;
    text-decoration: none;
}
.login-page .auth-language .dropdown-menu > li > a,
.login-page .bootstrap-select .dropdown-menu li:not(.disabled) > a {
    color: var(--auth-text);
    text-decoration: none;
}
.login-page .bootstrap-select .dropdown-menu li:not(.disabled) > a:hover,
.login-page .bootstrap-select .dropdown-menu li:not(.disabled) > a:focus,
.login-page .bootstrap-select .dropdown-menu li.active:not(.disabled) > a,
.login-page .bootstrap-select .dropdown-menu li.selected:not(.disabled) > a {
    background: var(--auth-hover) !important;
    border-color: var(--auth-hover) !important;
    color: var(--auth-link) !important;
}
/* The legacy theme marks active/hover menu colors !important; keep the override login-scoped. */
.login-page .dropdown-menu > li > a:hover,
.login-page .dropdown-menu > li > a:focus,
.login-page .dropdown-menu > .active > a,
.login-page .dropdown-menu > .selected > a {
    background: var(--auth-hover) !important;
    border-color: var(--auth-hover) !important;
    color: var(--auth-link) !important;
}
.login-page .bootstrap-select .dropdown-menu.inner { border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0; }
.login-page .dropdown-header { padding: 10px 12px; white-space: normal; color: var(--auth-muted); }
.login-page .bootstrap-select .bs-searchbox { padding: 4px 4px 10px; }
.login-page .bootstrap-select .bs-searchbox input { height: 44px; min-height: 44px; padding: 9px 12px; }
.login-page .bootstrap-select .no-results { padding: 10px; background: var(--auth-field); color: var(--auth-muted); white-space: normal; }
.login-page .auth-notice,
.login-page .alert-warning { padding: 12px 14px; margin-bottom: 20px; border: 1px solid var(--auth-gold); border-radius: 8px; background: var(--auth-hover); color: var(--auth-text); line-height: 1.6; }
.login-page .has-error .form-control { border-color: var(--auth-error) !important; }
.login-page .help-block { color: var(--auth-error); font-size: 12px; margin: 8px 0 0; }

/* A wide footer row, separate from the login card. Normal flow prevents any overlap. */
.login-page .auth-cookie {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 12px 16px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: var(--auth-panel);
    text-align: left;
}
.login-page .auth-cookie-copy { flex: 1; min-width: 0; }
.login-page .auth-cookie p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--auth-muted); }
.login-page .auth-cookie a,
.login-page .auth-cookie a:hover,
.login-page .auth-cookie a:focus { color: var(--auth-link); text-decoration: underline; }
.login-page .auth-cookie-actions { display: flex; flex: 0 0 230px; gap: 10px; }
.login-page .auth-cookie-actions .btn { flex: 1; min-width: 0; min-height: 44px; height: 44px; padding: 9px 16px; font-size: 14px; }
.login-page #loadingBackdrop { background: #000; opacity: .75; }
.login-page #loadingInfoContainer { color: #fff; }
.login-page #loadingInfo i { color: var(--auth-gold) !important; }
.login-page .lds-roller { display: none; }
/* Keep the footer and the 52px form controls visible on shorter desktop screens. */
@media (min-width: 768px) and (max-height: 900px) {
    .login-page { --auth-page-padding-y: 16px; }
    .login-page .auth-card { padding-top: 22px; padding-bottom: 22px; }
    .login-page .auth-header { margin-bottom: 16px; }
    .login-page .auth-brand { padding-top: 8px; padding-bottom: 8px; }
    .login-page .auth-brand img { width: 230px; }
    .login-page .auth-eyebrow { margin-top: 12px; }
    .login-page .form-group { margin-bottom: 14px; }
    .login-page .g-recaptcha { margin-top: 0; margin-bottom: 16px; }
    .login-page .auth-forgot { margin-top: 10px; }
    .login-page .auth-options { margin-top: 16px; padding-top: 16px; }
    .login-page .auth-footer { margin-top: 16px; }
}
@media (min-width: 768px) and (max-height: 800px) {
    .login-page { --auth-page-padding-y: 12px; }
    .login-page .auth-eyebrow { display: none; }
    .login-page .auth-footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 12px; }
    .login-page .form-group { margin-bottom: 12px; }
    .login-page .g-recaptcha { margin-bottom: 12px; }
}
@media (max-width: 767px) {
    .login-page .auth-cookie { flex-direction: column; align-items: stretch; gap: 12px; }
    .login-page .auth-cookie-actions { flex-basis: auto; }
    .login-page .auth-theme-toggle { min-width: 88px; padding: 0 12px; }
}
@media (max-width: 480px) {
    .login-page { --auth-page-padding-x: 16px; }
    .login-page .auth-card { padding: 24px 20px; border-radius: 8px; }
    .login-page .auth-brand img { width: 238px; }
    .login-page .auth-cookie { padding: 12px; }
}
@media (max-width: 375px) {
    .login-page { --auth-page-padding-y: 16px; --auth-page-padding-x: 12px; }
    .login-page .auth-card { padding: 24px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-page .form-control, .login-page .btn { transition: none; }
    .login-page .auth-button-spinner { animation: none; }
}
