:root {
    --card-background: #b6b1b9;
    --card-border: 1px solid #334155;
    --card-borderradius: 18px;
    --card-padding: 28px;
    --card-boxshadow: 0 24px 80px rgba(0, 0, 0, .35);
    --authpage-body-background: #0f172a;
    --authpage-body-color: #690069;
    --authpage-site-color: #800080;
    --authpage-site-fontsize: 2.25em;
    --authpage-site-fontweight: 700;
    --authpage-site-letterspacing: 0.1em;
    --authpage-h1-color: var(--authpage-site-color);
    --authpage-h1-fontsize: 1.5em;
    --authpage-h1-fontweight: 700;
    --authpage-h1-margin: 0 0 12px;
    --authpage-h2-color: var(--authpage-site-color);
    --authpage-h2-fontsize: 1.125em;
    --authpage-h2-fontweight: 700;
    --authpage-h2-margin: 0 0 12px;
    --authpage-hint-color: #220022;
    --authpage-input-color: #290329;
    --authpage-input-background: #fdeafd;
    --authpage-input-border: 1px solid #475569;
    --authpage-input-borderradius: 12px;
    --authpage-msginfo-background: var(--card-background);
    --authpage-msginfo-color: #750275;
    --authpage-msginfo-fontweight: 700;
    --authpage-button-color: #0f172a;
    --authpage-button-background: #c04dc0;
    --authpage-button-fontweight: 700;
    --authpage-button-fontfamily: inherit;
    --authpage-button-fontsize: 0.9em;
    --authpage-button-border: 1px solid #c04dc0;
    --authpage-button-borderradius: 12px;
    --authpage-button-padding: 12px 14px;
    --authpage-button-hover-filter: brightness(1.05);
    --authpage-button2-color: var(--authpage-input-color);
    --authpage-button2-background: transparent;
    --authpage-button2-border: var(--authpage-input-border);
    --authpage-button2-boxsizing: border-box;
    --authpage-forgotlink-color: var(--authpage-site-color);
    --authpage-forgotlink-fontweight: 700;
    --authpage-forgotlink-hover-textdecoration: underline;
    --authpage-footer-color: #800080;
    --authpage-footer-fontsize: 0.75em;
    --authpage-footer-fontweight: 400;
    --authpage-footer-link-color: var(--authpage-footer-color);
}

body.frusrmgt-auth-page {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--authpage-body-background);
    color: var(--authpage-body-color);
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

/* Background image(s), see lib/login_background.php. The color stays
   underneath, so it shows while an image loads and wherever none is set. */
.frusrmgt-auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.frusrmgt-auth-bg-layer {
    position: absolute;
    inset: 0;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.frusrmgt-auth-bg-layer.is-active {
    opacity: 1;
}

/* Blur pulls in the edges of the image; scaling up hides that soft rim. */
.frusrmgt-auth-bg.is-blurred .frusrmgt-auth-bg-layer {
    filter: blur(var(--authpage-bg-blur, 0));
    transform: scale(1.08);
}

/* A layer of the background color over the image, at the chosen opacity. */
.frusrmgt-auth-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--authpage-body-background);
    opacity: var(--authpage-bg-overlay, 0);
}

@media (prefers-reduced-motion: reduce) {
    .frusrmgt-auth-bg-layer {
        transition: none;
    }
}

.frusrmgt-auth-card {
    position: relative;
    z-index: 1;
    /* border-box so a narrow screen doesn't push the padding off the edges;
       the padding is added to the width so the desktop size stays as it was. */
    box-sizing: border-box;
    width: min(100%, calc(440px + 2 * var(--card-padding)));
    background: var(--card-background);
    border: var(--card-border);
    border-radius: var(--card-borderradius);
    padding: var(--card-padding);
    box-shadow: var(--card-boxshadow);
}

.frusrmgt-auth-card-wide {
    width: min(100%, calc(460px + 2 * var(--card-padding)));
}

.frusrmgt-auth-page .site-title {
    font-size: var(--authpage-site-fontsize);
    color: var(--authpage-site-color);
    font-weight: var(--authpage-site-fontweight);
    letter-spacing: var(--authpage-site-letterspacing);
    margin: 0 0 10px;
    line-height: 1.3;
    text-align: center;
}

.frusrmgt-auth-page h1 {
    margin: var(--authpage-h1-margin);
    font-size: var(--authpage-h1-fontsize);
    color: var(--authpage-h1-color);
    font-weight: var(--authpage-h1-fontweight);
}

.frusrmgt-auth-page h2 {
    margin: var(--authpage-h2-margin);
    font-size: var(--authpage-h2-fontsize);
    color: var(--authpage-h2-color);
    font-weight: var(--authpage-h2-fontweight);
}

.frusrmgt-auth-page p {
    line-height: 1.5;
}

.frusrmgt-auth-page .hint {
    color: var(--authpage-hint-color);
    font-size: 14px;
}

.frusrmgt-auth-page .small {
    font-size: 12px;
    color: #94a3b8;
}

.frusrmgt-auth-page label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 600;
}

.frusrmgt-auth-page input[type="text"],
.frusrmgt-auth-page input[type="password"],
.frusrmgt-auth-page input[type="email"] {
    color: var(--authpage-input-color);
    background: var(--authpage-input-background);
    border: var(--authpage-input-border);
    border-radius: var(--authpage-input-borderradius);
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
}

.frusrmgt-auth-page button,
.frusrmgt-auth-page .linkbtn {
    color: var(--authpage-button-color);
    background: var(--authpage-button-background);
    font-weight: var(--authpage-button-fontweight);
    font-family: var(--authpage-button-fontfamily);
    font-size: var(--authpage-button-fontsize);
    border: var(--authpage-button-border);
    border-radius: var(--authpage-button-borderradius);
    padding: var(--authpage-button-padding);
    margin-top: 18px;
    width: 100%;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    text-align: center;
}

.frusrmgt-auth-page button:hover {
    filter: var(--authpage-button-hover-filter);
}

.frusrmgt-auth-page .linkbtn.secondary {
    background: var(--authpage-button2-background);
    color: var(--authpage-button2-color);
    border: var(--authpage-button2-border);
    box-sizing: var(--authpage-button2-boxsizing);
}

.frusrmgt-auth-page .error {
    background: #7f1d1d;
    color: #fee2e2;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.frusrmgt-auth-page .msg {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.frusrmgt-auth-page .msg.info {
    background: var(--authpage-msginfo-background);
    color: var(--authpage-msginfo-color);
    font-weight: var(--authpage-msginfo-fontweight);
}

.frusrmgt-auth-page .msg.success {
    background: #14532d;
    color: #dcfce7;
}

.frusrmgt-auth-page .msg.error {
    background: #7f1d1d;
    color: #fee2e2;
}

.frusrmgt-auth-page .row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.frusrmgt-auth-page .row input {
    width: auto;
}

.frusrmgt-auth-page .row label {
    margin: 0;
    font-weight: 500;
}

.frusrmgt-auth-page code {
    word-break: break-all;
}

.frusrmgt-auth-page .forgot-link {
    display: block;
    margin-top: 14px;
    text-align: center;
    color: var(--authpage-forgotlink-color);
    font-weight: var(--authpage-forgotlink-fontweight);
    text-decoration: none;
}

.frusrmgt-auth-page .forgot-link:hover {
    text-decoration: var(--authpage-forgotlink-hover-textdecoration);
}

.frusrmgt-qr-box {
    background: #fff;
    border-radius: 16px;
    padding: 14px;
    display: inline-block;
    margin: 8px 0 12px;
}

.frusrmgt-captcha-wrap .captcha-code {
    display: flex;
    align-items: center;
    cursor: auto;
    margin-top: 0 !important;
    flex-wrap: wrap;
}

#captcha-code {
    height: auto !important;
    width: 100%;
    box-sizing: border-box;
}

.frusrmgt-captcha-wrap .captcha-code img {
    margin-bottom: 4px;
    margin-right: 12px;
    border: 1px solid #334155;
}

.frusrmgt-captcha-wrap .captcha_table {
    margin-top: 0 !important;
}

.frusrmgt-auth-footer {
    color: var(--authpage-footer-color);
    font-size: var(--authpage-footer-fontsize);
    font-weight: var(--authpage-footer-fontweight);
    text-align: center;
    line-height: 32px;
}

.frusrmgt-auth-footer-link {
    color: var(--authpage-footer-link-color);
}

/* Honeypot: kept in the DOM for bots but off-screen and unreachable for real users/keyboard nav. */
.frusrmgt-hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
    opacity: 0;
}