body.rs-auth-body {
    --rs-auth-bg: url('../../img/backgrounds/installer-bg.svg?v=f4-bg-polish');
    position: relative;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        linear-gradient(135deg, rgba(243, 246, 250, 0.64), rgba(232, 238, 245, 0.46)),
        var(--rs-auth-bg),
        var(--rs-bg-image);
    background-size: cover, cover, cover;
    background-position: center, center, center;
    background-attachment: fixed, fixed, fixed;
    font-weight: 300;
}

html[data-rs-theme="gelap"] body.rs-auth-body {
    background-image:
        linear-gradient(135deg, rgba(14, 18, 24, 0.76), rgba(10, 12, 16, 0.68)),
        var(--rs-auth-bg),
        var(--rs-bg-image);
}

body.rs-auth-body h1,
body.rs-auth-body h2,
body.rs-auth-body h3,
body.rs-auth-body h4,
body.rs-auth-body h5,
body.rs-auth-body h6,
body.rs-auth-body strong,
body.rs-auth-body b {
    font-weight: 300;
}

.rs-auth-topbar,
.rs-auth-footer {
    position: relative;
    z-index: 2;
}

.rs-auth-topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding-top: 0.55rem;
    padding-bottom: 0.35rem;
}

.rs-auth-brand,
.rs-auth-footer .rs-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.68rem;
    color: var(--rs-text);
    text-decoration: none;
}

.rs-auth-brand:hover,
.rs-auth-footer .rs-site-brand:hover {
    color: var(--rs-text);
    text-decoration: none;
}

.rs-auth-body .rs-site-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--rs-border);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.62);
    color: var(--rs-text);
    font-size: 0.92rem;
    box-shadow: var(--rs-shadow-sm);
}

html[data-rs-theme="gelap"] .rs-auth-body .rs-site-brand__mark {
    background: rgba(16, 19, 24, 0.74);
    border-color: rgba(255, 255, 255, 0.08);
}

.rs-auth-body .rs-site-brand strong {
    color: var(--rs-text);
    font-size: 0.95rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.rs-auth-topbar__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.rs-auth-body .rs-theme-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--rs-shadow-sm);
}

html[data-rs-theme="gelap"] .rs-auth-body .rs-theme-toggle {
    background: rgba(16, 19, 24, 0.74);
    color: var(--rs-text-soft);
    border-color: rgba(255, 255, 255, 0.08);
}

.rs-auth-main {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    padding: clamp(1.25rem, 5vh, 3.25rem) 0 clamp(1rem, 4vh, 2.25rem);
}

.rs-auth-container {
    width: 100%;
    max-width: 1040px;
}

.rs-auth-shell {
    display: flex;
    justify-content: center;
    align-items: center;
}

.rs-auth-card {
    width: min(100%, 430px);
    padding: clamp(1.2rem, 2.2vw, 1.55rem);
    border: 1px solid var(--rs-border);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--rs-shadow-md);
    backdrop-filter: blur(18px);
}

html[data-rs-theme="gelap"] .rs-auth-card {
    background: rgba(20, 24, 29, 0.78);
    border-color: rgba(255, 255, 255, 0.08);
}

.rs-auth-card__header {
    margin-bottom: 0.9rem;
}

.rs-auth-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.35rem);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.rs-auth-card .rs-form-stack {
    gap: 0.82rem;
}

.rs-auth-card .rs-field {
    gap: 0.42rem;
}

.rs-auth-card .rs-label {
    color: var(--rs-text-soft);
    font-size: 0.88rem;
}

.rs-auth-card .rs-input {
    min-height: 48px;
    border-radius: 0;
    background: rgba(235, 241, 250, 0.78);
}

html[data-rs-theme="gelap"] .rs-auth-card .rs-input {
    background: rgba(43, 50, 60, 0.72);
    border-color: rgba(255, 255, 255, 0.09);
}

.rs-auth-actions {
    display: flex;
    align-items: center;
    gap: 0.62rem;
    flex-wrap: wrap;
    margin-top: 0.2rem;
}

.rs-auth-actions .rs-btn {
    min-height: 42px;
    padding: 0.68rem 1.05rem;
}

.rs-auth-actions .rs-btn-primary {
    min-width: 108px;
}

.rs-auth-actions .rs-btn-icon {
    width: 42px;
    min-width: 42px;
    padding-right: 0;
    padding-left: 0;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.38);
}

.rs-auth-actions .rs-btn-icon svg {
    width: 1.05rem;
    height: 1.05rem;
}

.rs-auth-actions .rs-btn-icon:hover {
    border-color: var(--rs-border);
    background: var(--rs-panel-strong);
}

html[data-rs-theme="gelap"] .rs-auth-actions .rs-btn-primary {
    background: #2b323b;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-rs-theme="gelap"] .rs-auth-actions .rs-btn-icon {
    background: rgba(12, 15, 19, 0.55);
    color: var(--rs-text-soft);
    border-color: rgba(255, 255, 255, 0.06);
}

.rs-auth-footer {
    margin-top: auto;
    padding-bottom: 1rem;
}

.rs-auth-footer__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    padding-top: 0.85rem;
    border-top: 1px solid var(--rs-border);
}

.rs-auth-footer__brand {
    display: grid;
    gap: 0.42rem;
    max-width: 520px;
}

.rs-auth-footer p,
.rs-auth-footer__meta {
    margin: 0;
    color: var(--rs-text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.rs-auth-footer__meta {
    display: flex;
    gap: 0.85rem;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    text-align: right;
}

.rs-auth-body .alert,
.rs-auth-body .rs-form-errors {
    border: 1px solid var(--rs-border);
    border-radius: 0;
    background: var(--rs-panel-strong);
    color: var(--rs-text);
    box-shadow: none !important;
}

@media (max-width: 575.98px) {
    .rs-auth-body .container {
        width: 100%;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .rs-auth-topbar__inner {
        min-height: 54px;
        padding-top: 0.4rem;
        padding-bottom: 0.2rem;
    }

    .rs-auth-body .rs-site-brand__mark {
        width: 30px;
        height: 30px;
        border-radius: 0;
    }

    .rs-auth-body .rs-site-brand strong {
        font-size: 0.9rem;
        letter-spacing: 0.12em;
    }

    .rs-auth-body .rs-theme-toggle {
        width: 38px;
        height: 38px;
    }

    .rs-auth-main {
        align-items: start;
        padding: 0.95rem 0 1rem;
    }

    .rs-auth-card {
        width: 100%;
        padding: 1.1rem;
        border-radius: 0;
    }

    .rs-auth-title {
        font-size: 2rem;
    }

    .rs-auth-card .rs-input {
        min-height: 48px;
    }

    .rs-auth-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        gap: 0.55rem;
    }

    .rs-auth-actions .rs-btn {
        min-height: 44px;
    }

    .rs-auth-actions .rs-btn-primary {
        width: 100%;
    }

    .rs-auth-actions .rs-btn-icon {
        width: 44px;
        min-width: 44px;
    }

    .rs-auth-footer {
        padding-bottom: 0.85rem;
    }

    .rs-auth-footer__inner {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding-top: 0.75rem;
    }

    .rs-auth-footer__brand {
        gap: 0.38rem;
    }

    .rs-auth-footer p,
    .rs-auth-footer__meta {
        font-size: 0.8rem;
        line-height: 1.48;
    }

    .rs-auth-footer__meta {
        justify-content: flex-start;
        text-align: left;
        gap: 0.55rem;
    }
}


/* F4 dark background polish */
html[data-rs-theme="gelap"] body.rs-auth-body {
    background-color: #090d11;
    background-image:
        radial-gradient(circle at 18% 34%, rgba(249, 115, 22, 0.15), transparent 28%),
        radial-gradient(circle at 82% 14%, rgba(59, 130, 246, 0.10), transparent 34%),
        linear-gradient(135deg, rgba(7, 10, 14, 0.86), rgba(9, 13, 18, 0.82)),
        var(--rs-auth-bg),
        linear-gradient(135deg, #080b0f, #11161d);
}


/* F5 final thin typography override */
:where(body, button, input, select, textarea, a, p, span, small, label, th, td, strong, b, h1, h2, h3, h4, h5, h6, .rs-btn, .btn, .rs-card, .rs-badge) {
    font-weight: 300 !important;
}
