/* ==========================================================================
   public_site.css - styles for the public (signed-out) pages: Login and Forgot Password.
   Loaded by Shared/Scripts/_CommonStylesPublic.cshtml, in place of site.css, so these pages
   don't download the sidebar / report-table / dashboard rules they never use.
   Keep the tokens below in step with site.css (same colours and sizes), so the signed-out
   pages look like the rest of the app.
   ========================================================================== */

/* ---- Tokens (same values as :root in site.css) ---- */
:root {
    --app-font-family: "Open Sans", Helvetica, Arial, sans-serif;
    --app-primary: #0d3991;                 /* the one place to change the brand colour */
    --app-border-color: #c6c6cd;
    --app-font-size: 0.75rem;               /* body text, form controls, buttons */
    --app-font-size-label: 0.75rem;         /* form labels */
    --app-control-height: 2.25rem;          /* height of inputs */
    --app-alert-danger-bg: #d63939;         /* tabler-alert danger and the login error box */
    --app-alert-success-bg: #dcfce7;        /* tabler-alert success */
    --app-alert-success-color: #166534;
}

/* Primary colour: Tabler builds buttons, links, focus rings and checkboxes from these,
   so redefining them recolours all of those together. The rgb() triplet must be the same
   colour as --app-primary. */
:root,
:root[data-bs-theme="light"],
[data-bs-theme="light"] {
    --tblr-primary: var(--app-primary);
    --tblr-primary-rgb: 13, 57, 145;
    --tblr-primary-fg: #ffffff;
    --tblr-link-color: var(--app-primary);
    --tblr-link-color-rgb: 13, 57, 145;
    --tblr-link-hover-color: #0b3079;
    --tblr-link-hover-color-rgb: 11, 48, 121;
}

/* ---- Base text ---- */
body,
.btn,
.form-control,
.dropdown-menu {
    font-family: var(--app-font-family);
    --tblr-border-color: var(--app-border-color);
}

body {
    --tblr-body-font-size: var(--app-font-size);
    font-size: var(--app-font-size);
}

[v-cloak] {
    display: none !important;
}

/* ---- Forms ---- */
.form-control:not(.form-control-sm):not(.form-control-lg),
.form-select:not(.form-select-sm):not(.form-select-lg),
.input-group-text,
.form-check-label {
    font-size: var(--app-font-size);
}

.form-control:not(.form-control-sm):not(.form-control-lg):not(textarea) {
    min-height: var(--app-control-height);
}

.form-label,
.col-form-label {
    font-size: var(--app-font-size-label);
}

.form-control:focus {
    border-color: var(--app-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 57, 145, 0.25);
}

.form-check-input:checked {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
}

/* ---- Buttons ---- */
.btn:not(.btn-sm):not(.btn-lg) {
    --tblr-btn-font-size: var(--app-font-size);
    font-size: var(--app-font-size);
}

.btn-primary {
    --tblr-btn-color: #fff;
    --tblr-btn-bg: #0d3991;
    --tblr-btn-border-color: transparent;
    --tblr-btn-hover-color: #fff;
    --tblr-btn-hover-bg: #0b3079;
    --tblr-btn-hover-border-color: transparent;
    --tblr-btn-focus-shadow-rgb: 13, 57, 145;
    --tblr-btn-active-color: #fff;
    --tblr-btn-active-bg: #092766;
    --tblr-btn-active-border-color: transparent;
    --tblr-btn-disabled-color: #fff;
    --tblr-btn-disabled-bg: #0d3991;
    --tblr-btn-disabled-border-color: transparent;
}

/* ---- tabler-alert (the message shown after "Forgot password" and similar) ---- */
.tabler-alert-wrap .alert {
    position: relative;
    display: flex;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

    .tabler-alert-wrap .alert.alert-dismissible {
        padding-right: 3rem;
    }

.tabler-alert-wrap .alert-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.tabler-alert-wrap .alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.tabler-alert-wrap .btn-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.tabler-alert-wrap .alert-success {
    color: var(--app-alert-success-color);
    background-color: var(--app-alert-success-bg);
    border-color: var(--app-alert-success-bg);
}

.tabler-alert-wrap .alert-danger {
    color: #fff;
    background-color: var(--app-alert-danger-bg);
    border-color: var(--app-alert-danger-bg);
}

.tabler-alert-wrap .alert-warning {
    color: #fff;
    background-color: #f59f00;
    border-color: #f59f00;
}

.tabler-alert-wrap .alert-info {
    color: #fff;
    background-color: #4299e1;
    border-color: #4299e1;
}

.tabler-alert-wrap .alert-title,
.tabler-alert-wrap .alert-icon,
.tabler-alert-wrap .alert a:not(.btn-close) {
    color: inherit;
}

/* white close button on the filled variants; success is light, so it keeps the dark one */
.tabler-alert-wrap .alert .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 0.7;
}

    .tabler-alert-wrap .alert .btn-close:hover {
        opacity: 1;
    }

.tabler-alert-wrap .alert-success .btn-close {
    filter: none;
    opacity: 0.6;
}

/* ---- Login: server-side validation summary ("Invalid username or password.") ----
   asp-validation-summary renders a plain <div class="alert alert-danger"><ul><li>..</li></ul></div>,
   which would get Tabler's default light alert with a bullet list. Login.cshtml adds the
   login-alert class; this makes it the same solid red as tabler-alert's danger variant.
   ASP.NET leaves an empty div (or .validation-summary-valid) when there are no errors, so
   both are hidden. */
.alert.login-alert {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--app-alert-danger-bg);
    border-radius: 4px;
    color: #fff;
    background-color: var(--app-alert-danger-bg);
}

    .alert.login-alert.validation-summary-valid,
    .alert.login-alert:empty {
        display: none;
    }

    .alert.login-alert::before {
        content: "\ea06";                   /* tabler icon: alert-circle */
        font-family: "tabler-icons";
        font-size: 1.25rem;
        line-height: 1;
        margin-right: 0.75rem;
    }

    .alert.login-alert ul {
        list-style: none;
        margin: 0;
        padding: 0;
    }

/* ==========================================================================
   Login page: logo top-left, a centred form over a light background image
   (login_bg.jpg, anchored bottom-right; the gradient behind it fills wide screens)
   ========================================================================== */
.login-shell {
    --login-ink: #141b2d;
    --login-muted: #5d6576;
    --login-line: #cfd5de;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    color: var(--login-ink);
    /* same top-to-bottom tones as the left edge of login_bg.jpg, so the two meet without a seam */
    background: linear-gradient(180deg, #eaeff3 0%, #e0e5e9 50%, #cdd2d8 100%);
}

    /* the background picture, full height on the right, its left edge faded into the gradient */
    .login-shell::before {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(100%, calc(100vh * 0.76));
        z-index: -1;
        background: url("../images/login_bg.jpg") right bottom / cover no-repeat;
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 35%);
        mask-image: linear-gradient(to right, transparent 0, #000 35%);
        pointer-events: none;
    }

.login-top {
    padding: 1.75rem 2rem 0;
}

.login-logo {
    display: block;
    height: 2.75rem;
    width: auto;
    mix-blend-mode: multiply;   /* the logo file has a white background */
}

.login-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.login-form-inner {
    width: 100%;
    max-width: 22rem;
}

.login-title {
    margin: 0 0 0.35rem;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--login-ink);
}

.login-subtitle {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--login-muted);
}

    .login-subtitle strong {
        font-weight: 600;
        color: var(--login-ink);
    }

.login-branch {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    color: var(--login-muted);
}

    .login-branch .ti {
        font-size: 1rem;
        color: var(--app-primary);
    }

.login-form {
    margin-top: 1.75rem;
}

.login-field {
    margin-bottom: 1rem;
}

.login-input {
    position: relative;
}

    .login-input .form-control.form-control {
        height: 2.875rem;
        padding-left: 2.75rem;
        padding-right: 2.75rem;
        font-size: 0.875rem;
        border-color: var(--login-line);
        border-radius: 0.5rem;
        background-color: rgba(255, 255, 255, 0.85);
    }

        .login-input .form-control::placeholder {
            color: #7d8494;
        }

.login-input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--login-muted);
    pointer-events: none;
}

.login-password-toggle {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--login-muted);
    font-size: 1.15rem;
    cursor: pointer;
}

    .login-password-toggle:hover {
        color: var(--login-ink);
    }

    .login-password-toggle:focus-visible {
        outline: 2px solid var(--app-primary);
        outline-offset: 1px;
    }

.login-field-error {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--app-alert-danger-bg);
}

    .login-field-error:empty {
        display: none;
    }

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.25rem 0 1.25rem;
    font-size: 0.8125rem;
}

    .login-options .form-check-label.form-check-label {
        font-size: 0.8125rem;
        color: var(--login-ink);
    }

    .login-options a {
        font-weight: 600;
    }

.btn.login-submit:not(.btn-sm):not(.btn-lg) {
    --tblr-btn-font-size: 0.9375rem;
    height: 2.875rem;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

    .btn.login-submit .ti {
        font-size: 1.1rem;
    }

.login-tagline {
    margin: 2rem auto 0;
    padding-top: 1rem;
    max-width: 12rem;
    border-top: 1px solid var(--login-line);
    text-align: center;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: var(--login-muted);
}

.login-notice {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.65rem 0.8rem;
    border-radius: 0.5rem;
    background: #e8f0fe;
    color: #1e3a8a;
    font-size: 0.8125rem;
}

    .login-notice .ti {
        font-size: 1rem;
        margin-top: 0.05rem;
    }

.login-form-inner .alert.login-alert {
    border-radius: 0.5rem;
    font-size: 0.8125rem;
}

.login-footer {
    padding: 0 2rem 1.25rem;
    font-size: 0.75rem;
    color: var(--login-muted);
}

/* Phones: the background image would crowd the form, so only the gradient shows */
@media (max-width: 575.98px) {
    .login-shell::before {
        display: none;
    }

    .login-main {
        align-items: flex-start;
        padding-top: 3rem;
    }

    .login-top {
        padding: 1.25rem 1.25rem 0;
    }

    .login-logo {
        height: 2.25rem;
    }

    .login-footer {
        padding: 0 1.25rem 1rem;
        text-align: center;
    }
}
