:root {
    --auth-bg-gradient:
        radial-gradient(1100px 520px at 50% -18%, rgba(86, 130, 255, 0.2), transparent 62%),
        radial-gradient(780px 430px at 15% 105%, rgba(69, 210, 255, 0.14), transparent 68%),
        linear-gradient(140deg, #060a14 0%, #0a1122 45%, #0c1730 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(120, 146, 255, 0.5), rgba(95, 98, 255, 0.18));
    --auth-glow-b: linear-gradient(120deg, rgba(44, 181, 235, 0.45), rgba(90, 255, 224, 0.14));
    --auth-text: #edf3ff;
    --auth-title: #f7faff;
    --auth-title-shadow: 0 2px 12px rgba(80, 120, 255, 0.25);
    --auth-danger: #ff9d9d;
    --auth-card-top: rgba(20, 34, 66, 0.9);
    --auth-card-bottom: rgba(11, 21, 41, 0.86);
    --auth-card-border: rgba(142, 171, 241, 0.34);
    --auth-card-shadow: 0 24px 60px rgba(2, 8, 24, 0.62), inset 0 1px 0 rgba(208, 224, 255, 0.1);
    --auth-field-shell-bg: #0e182e;
    --auth-field-shell-border: rgba(126, 151, 215, 0.2);
    --auth-field-shell-border-bottom: rgba(126, 151, 215, 0.58);
    --auth-field-shell-hover-bg: #111e3b;
    --auth-field-shell-focus-bg: #142344;
    --auth-field-shell-focus-border: rgba(158, 188, 255, 0.9);
    --auth-field-shell-focus-bottom: #73a6ff;
    --auth-icon: rgba(182, 200, 241, 0.9);
    --auth-input-text: #f1f7ff;
    --auth-input-placeholder: rgba(189, 206, 242, 0.56);
    --auth-toggle: #b6c7f4;
    --auth-toggle-hover-bg: rgba(81, 109, 178, 0.38);
    --auth-toggle-hover: #e7efff;
    --auth-remember: rgba(188, 204, 236, 0.78);
    --auth-checkbox: #5b69d9;
    --auth-accent-a: #5362cf;
    --auth-accent-b: #2a8fb2;
    --auth-accent-a-hover: #5b69d9;
    --auth-accent-b-hover: #2d97bc;
    --auth-submit-shadow: 0 6px 14px rgba(20, 45, 95, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    --auth-submit-shadow-hover: 0 9px 18px rgba(20, 45, 95, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --auth-theme-btn-bg: rgba(20, 34, 66, 0.72);
    --auth-theme-btn-border: rgba(142, 171, 241, 0.35);
    --auth-theme-btn-color: rgba(210, 224, 255, 0.92);
    --auth-theme-btn-hover-bg: rgba(28, 46, 88, 0.88);
    --auth-theme-panel-bg: rgba(16, 28, 54, 0.96);
    --auth-theme-panel-border: rgba(142, 171, 241, 0.28);
    --auth-theme-panel-text: rgba(220, 230, 255, 0.92);
    --auth-theme-panel-muted: rgba(188, 204, 236, 0.62);
    --auth-theme-item-hover: rgba(255, 255, 255, 0.07);
    --auth-theme-item-active: rgba(115, 166, 255, 0.16);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    background: var(--auth-bg-gradient);
    color: var(--auth-text);
    overflow-x: hidden;
}

body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    filter: blur(56px);
    opacity: 0.42;
    border-radius: 44% 56% 53% 47% / 53% 45% 55% 47%;
}

body::before {
    width: 420px;
    height: 320px;
    left: -120px;
    top: -100px;
    background: var(--auth-glow-a);
    transform: rotate(-8deg);
}

body::after {
    width: 390px;
    height: 300px;
    right: -120px;
    bottom: -120px;
    background: var(--auth-glow-b);
    transform: rotate(12deg);
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.auth-card {
    width: min(460px, 100%);
    background: linear-gradient(180deg, var(--auth-card-top) 0%, var(--auth-card-bottom) 100%);
    border: 1px solid var(--auth-card-border);
    border-radius: 18px;
    box-shadow: var(--auth-card-shadow);
    backdrop-filter: blur(14px);
    padding: 34px 32px 26px;
}

.auth-title {
    margin: 0 0 28px;
    font-size: 26px;
    font-weight: 800;
    color: var(--auth-title);
    text-align: center;
    letter-spacing: 0.3px;
    text-shadow: var(--auth-title-shadow);
}

.field {
    margin-bottom: 16px;
}

.field:last-of-type {
    margin-bottom: 18px;
}

.field-shell {
    position: relative;
    border-radius: 10px;
    background: var(--auth-field-shell-bg);
    border: 1px solid var(--auth-field-shell-border);
    border-bottom: 2px solid var(--auth-field-shell-border-bottom);
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.2s ease;
    /* Clip autofill paint so it cannot cover rounded border corners */
    overflow: hidden;
    isolation: isolate;
}

.field-shell:hover {
    background: var(--auth-field-shell-hover-bg);
}

.field-shell:focus-within {
    border-color: var(--auth-field-shell-focus-border);
    border-bottom-color: var(--auth-field-shell-focus-bottom);
    background: var(--auth-field-shell-focus-bg);
    box-shadow: 0 8px 20px rgba(18, 40, 94, 0.24);
}
html.theme-slate .field-shell:focus-within {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(127, 200, 170, 0.12);
}


.field-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--auth-icon);
    pointer-events: none;
}

.field-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-control {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent !important;
    color: var(--auth-input-text);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.12px;
    padding: 16px 38px 16px 42px;
    margin: 0;
    border-radius: 8px;
}

.field-control::placeholder {
    color: var(--auth-input-placeholder);
    font-weight: 400;
}

.field-control:-webkit-autofill,
.field-control:-webkit-autofill:hover,
.field-control:-webkit-autofill:focus,
.field-control:-webkit-autofill:active {
    /* Kill Chrome/Edge autofill wash-out; keep corners under field-shell border */
    -webkit-text-fill-color: var(--auth-input-text) !important;
    caret-color: var(--auth-input-text) !important;
    color: var(--auth-input-text) !important;
    border-radius: 8px !important;
    background-color: var(--auth-field-shell-bg) !important;
    background-clip: padding-box !important;
    background-image: none !important;
    /* Smaller inset than before — parent overflow:hidden clips the rest */
    -webkit-box-shadow: 0 0 0 40px var(--auth-field-shell-bg) inset !important;
    box-shadow: 0 0 0 40px var(--auth-field-shell-bg) inset !important;
    transition: background-color 99999s ease-out 0s !important;
    filter: none !important;
}
.field-shell:has(> .field-control:-webkit-autofill),
.field-shell:has(.field-control:-webkit-autofill) {
    background: var(--auth-field-shell-bg) !important;
}
.field-shell:focus-within:has(.field-control:-webkit-autofill) {
    background: var(--auth-field-shell-focus-bg) !important;
}
.field-shell:focus-within .field-control:-webkit-autofill {
    border-radius: 8px !important;
    -webkit-box-shadow: 0 0 0 40px var(--auth-field-shell-focus-bg) inset !important;
    box-shadow: 0 0 0 40px var(--auth-field-shell-focus-bg) inset !important;
    background-color: var(--auth-field-shell-focus-bg) !important;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--auth-toggle);
    cursor: pointer;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    transition: background 0.15s ease, color 0.15s ease;
    z-index: 1;
}

.password-toggle:hover {
    background: var(--auth-toggle-hover-bg);
    color: var(--auth-toggle-hover);
}

.password-toggle svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
    flex-wrap: wrap;
}

.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 13px;
    color: var(--auth-remember);
    user-select: none;
    cursor: pointer;
    position: relative;
}

.auth-forgot-link {
    border: 0;
    background: none;
    padding: 0;
    margin: 0;
    color: var(--auth-field-shell-focus-bottom);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.auth-forgot-link:hover,
.auth-forgot-link:focus-visible {
    opacity: 0.85;
    outline: none;
}

.auth-forgot-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.auth-remember input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.auth-remember-box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid color-mix(in srgb, var(--auth-checkbox) 55%, transparent);
    background: color-mix(in srgb, var(--auth-field-shell-bg) 80%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.auth-remember-box::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    margin-top: -1px;
    transition: transform 0.14s ease, opacity 0.14s ease;
}

.auth-remember input:checked + .auth-remember-box {
    background: linear-gradient(145deg, var(--auth-checkbox), color-mix(in srgb, var(--auth-checkbox) 70%, #000));
    border-color: var(--auth-checkbox);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-checkbox) 22%, transparent);
}

.auth-remember input:checked + .auth-remember-box::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.auth-remember:hover .auth-remember-box {
    border-color: var(--auth-checkbox);
}

.auth-remember input:focus-visible + .auth-remember-box {
    outline: 2px solid color-mix(in srgb, var(--auth-checkbox) 70%, transparent);
    outline-offset: 2px;
}

.auth-remember-text {
    line-height: 1.2;
}

.human-check {
    display: flex;
    align-items: stretch;
    margin-top: 14px;
    border: 1px solid var(--auth-card-border);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.16);
    min-height: 54px;
}

html.theme-light .human-check {
    background: rgba(255, 255, 255, 0.92);
}

.human-check-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.human-check-main:disabled {
    cursor: wait;
}

.human-check-box {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    border: 2px solid color-mix(in srgb, var(--auth-checkbox) 70%, #888);
    background: rgba(255, 255, 255, 0.04);
    flex: 0 0 auto;
    position: relative;
    box-sizing: border-box;
}

.human-check-box::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    opacity: 0;
    transition: transform 0.14s ease, opacity 0.14s ease;
}

.human-check.is-verified .human-check-box {
    background: linear-gradient(145deg, var(--auth-checkbox), color-mix(in srgb, var(--auth-checkbox) 70%, #000));
    border-color: var(--auth-checkbox);
}

.human-check.is-verified .human-check-box::after {
    transform: rotate(45deg) scale(1);
    opacity: 1;
}

.human-check.is-error .human-check-box {
    border-color: #e57373;
    box-shadow: 0 0 0 3px rgba(229, 115, 115, 0.18);
}

.human-check-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--auth-input-text, inherit);
}

.human-check-spinner {
    width: 16px;
    height: 16px;
    margin-left: auto;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--auth-checkbox);
    animation: human-spin 0.7s linear infinite;
}

.human-check-spinner[hidden] {
    display: none !important;
}

@keyframes human-spin {
    to { transform: rotate(360deg); }
}

.human-check-side {
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-left: 1px solid var(--auth-card-border);
    color: #2ecc71;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: lowercase;
    user-select: none;
}

.human-check-shield {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #2ecc71;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 1;
}

html.theme-light .human-check-side {
    color: #1fa855;
}

html.theme-light .human-check-shield {
    stroke: #1fa855;
}

.human-honeypot {
    position: absolute !important;
    left: -10000px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
}

.auth-submit {
    width: 100%;
    margin-top: 18px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-accent-a) 0%, var(--auth-accent-b) 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    padding: 14px 14px;
    cursor: pointer;
    transition: transform 0.12s ease, opacity 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
    box-shadow: var(--auth-submit-shadow);
}

.auth-submit:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, var(--auth-accent-a-hover) 0%, var(--auth-accent-b-hover) 100%);
    box-shadow: var(--auth-submit-shadow-hover);
    filter: saturate(1.02);
}

.auth-submit:active { transform: translateY(0); }
.auth-submit[disabled] { opacity: 0.75; cursor: wait; }

.reg-status {
    display: none;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-align: left;
    font-size: 13px;
    line-height: 1.4;
}

.reg-status:not([hidden]) {
    display: block;
}

.reg-status-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.reg-status-text {
    opacity: 0.92;
    word-break: break-word;
}

.reg-status.is-pending {
    border-color: rgba(240, 173, 78, 0.45);
    background: rgba(240, 173, 78, 0.12);
    color: #f0ad4e;
}

.reg-status.is-rejected {
    border-color: rgba(217, 83, 79, 0.45);
    background: rgba(217, 83, 79, 0.12);
    color: #e27c79;
}

html.theme-light .reg-status.is-pending {
    border-color: rgba(180, 120, 20, 0.35);
    background: rgba(255, 193, 7, 0.14);
    color: #8a5a00;
}

html.theme-light .reg-status.is-rejected {
    border-color: rgba(180, 40, 40, 0.3);
    background: rgba(220, 53, 69, 0.1);
    color: #a12622;
}

.auth-error,
.auth-success {
    min-height: 0;
    margin-top: 0;
    font-size: 13px;
    text-align: center;
}
.auth-error:empty,
.auth-success:empty {
    display: none;
}
.auth-error:not(:empty),
.auth-success:not(:empty) {
    display: block;
    margin-top: 12px;
    min-height: 18px;
}
.auth-error {
    color: var(--auth-danger);
}
.auth-success {
    color: #79df98;
}

html.theme-light .auth-success {
    color: #2e7d32;
}

.auth-switch {
    margin: 26px 0 8px;
    padding-top: 4px;
    text-align: center;
    font-size: 13px;
    color: var(--auth-remember);
}

.auth-switch-btn {
    border: 0;
    background: none;
    padding: 0;
    margin-left: 4px;
    color: var(--auth-field-shell-focus-bottom);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-switch-btn:hover,
.auth-switch-btn:focus-visible {
    opacity: 0.85;
    outline: none;
}

.auth-register-note {
    margin: 0 0 12px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--auth-remember);
    text-align: center;
}

.captcha-field {
    margin-top: 0;
}

.captcha-row {
    display: grid;
    grid-template-columns: 168px 1fr;
    gap: 10px;
    align-items: stretch;
}

.captcha-image-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 168px;
    min-height: 52px;
    padding: 0;
    border: 1px solid var(--auth-card-border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    cursor: pointer;
    overflow: hidden;
}

.captcha-image-btn:hover,
.captcha-image-btn:focus-visible {
    outline: none;
    border-color: var(--auth-field-shell-focus-bottom);
    box-shadow: 0 0 0 1px rgba(158, 197, 255, 0.25);
}

.captcha-image-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.captcha-image-btn img {
    display: block;
    width: 168px;
    height: 52px;
    object-fit: cover;
}

.captcha-image-btn img[hidden],
.captcha-image-btn img:not([src]),
.captcha-image-btn img[src=""] {
    display: none !important;
}

.captcha-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--auth-remember);
    background: rgba(0, 0, 0, 0.18);
}

.captcha-image-placeholder[hidden] {
    display: none !important;
}

.captcha-input-shell {
    min-height: 52px;
}

.captcha-hint {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--auth-remember);
}

html.theme-light .captcha-image-btn {
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 520px) {
    .captcha-row {
        grid-template-columns: 1fr;
    }

    .captcha-image-btn {
        width: 100%;
    }

    .captcha-image-btn img {
        width: 100%;
    }
}

.auth-submit-secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid var(--auth-card-border);
    box-shadow: none;
}

.auth-submit-secondary:hover {
    background: linear-gradient(135deg, var(--auth-accent-a) 0%, var(--auth-accent-b) 100%);
    box-shadow: var(--auth-submit-shadow-hover);
}

html.theme-light .auth-submit-secondary {
    background: rgba(255, 255, 255, 0.92);
    color: var(--auth-input-text);
}

html.theme-light .auth-submit-secondary:hover {
    color: #fff;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.field-control-plain {
    padding-left: 14px !important;
}

#auth-register-view[hidden],
#auth-login-view[hidden] {
    display: none !important;
}

@media (max-width: 520px) {
    .field-row {
        grid-template-columns: 1fr;
    }
}

html.theme-light {
    --auth-theme-btn-bg: rgba(255, 255, 255, 0.9);
    --auth-theme-btn-border: rgba(0, 0, 0, 0.1);
    --auth-theme-btn-color: rgba(51, 51, 51, 0.88);
    --auth-theme-btn-hover-bg: rgba(255, 255, 255, 0.98);
    --auth-theme-panel-bg: rgba(255, 255, 255, 0.98);
    --auth-theme-panel-border: rgba(0, 0, 0, 0.1);
    --auth-theme-panel-text: #333;
    --auth-theme-panel-muted: rgba(85, 85, 85, 0.65);
    --auth-theme-item-hover: rgba(0, 0, 0, 0.05);
    --auth-theme-item-active: rgba(0, 0, 0, 0.07);
}

.auth-theme {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.auth-theme-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--auth-theme-btn-border);
    background: var(--auth-theme-btn-bg);
    color: var(--auth-theme-btn-color);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.auth-theme-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-theme-btn:hover,
.auth-theme-btn:focus-visible {
    background: var(--auth-theme-btn-hover-bg);
    transform: translateY(-1px);
    outline: none;
}

.auth-theme-btn[aria-expanded="true"] {
    background: var(--auth-theme-btn-hover-bg);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.auth-theme-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    padding: 8px;
    border-radius: 14px;
    border: 1px solid var(--auth-theme-panel-border);
    background: var(--auth-theme-panel-bg);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.auth-theme-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.auth-theme-panel-title {
    padding: 4px 10px 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--auth-theme-panel-muted);
}

.auth-theme-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: min(340px, calc(100vh - 120px));
    overflow-y: auto;
}

.auth-theme-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--auth-theme-panel-text);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-shadow: none !important;
    white-space: normal;
    cursor: pointer;
    transition: background 0.12s ease;
    filter: none !important;
    opacity: 1 !important;
}

.auth-theme-item:hover,
.auth-theme-item:focus-visible {
    background: var(--auth-theme-item-hover);
    outline: none;
}

.auth-theme-item.is-active {
    background: var(--auth-theme-item-active);
}

.auth-theme-item.is-disabled,
.auth-theme-item:disabled {
    cursor: not-allowed !important;
    pointer-events: auto;
    background: transparent !important;
}

.auth-theme-item.is-disabled .auth-theme-swatch,
.auth-theme-item:disabled .auth-theme-swatch {
    opacity: 0.65;
}

.auth-theme-item.is-disabled:hover,
.auth-theme-item.is-disabled:focus-visible,
.auth-theme-item:disabled:hover {
    background: transparent !important;
    cursor: not-allowed !important;
}

.auth-theme-item-text {
    display: none;
}

.auth-theme-item-label {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
    color: inherit;
    text-shadow: none !important;
}

.auth-theme-item.is-disabled .auth-theme-item-label,
.auth-theme-item:disabled .auth-theme-item-label {
    color: rgba(210, 218, 230, 0.78) !important;
}

.auth-theme-lock {
    display: block;
    margin-left: auto;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none !important;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    text-transform: none;
    color: #ffffff !important;
    text-shadow: none !important;
    white-space: nowrap;
    opacity: 1 !important;
    filter: none !important;
}

html.theme-light .auth-theme-item.is-disabled .auth-theme-item-label,
html.theme-light .auth-theme-item:disabled .auth-theme-item-label {
    color: rgba(55, 65, 75, 0.78) !important;
}

html.theme-light .auth-theme-lock {
    color: #1f2937 !important;
}

.auth-theme-swatch {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

html.theme-light .auth-theme-swatch {
    border-color: rgba(0, 0, 0, 0.12);
}

.auth-theme-item-label {
    flex: none;
    min-width: 0;
}

.auth-theme-check {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    opacity: 0;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-theme-item.is-active .auth-theme-check {
    opacity: 0.9;
}

@media (max-width: 520px) {
    .auth-wrap { padding: 16px; }
    .auth-card { padding: 28px 22px 20px; border-radius: 16px; }
    .auth-title { font-size: 23px; }
    .auth-theme { top: 14px; right: 14px; }
    .auth-theme-panel { width: min(196px, calc(100vw - 28px)); }
}

/* ===== cyborg (default) ===== */
html.theme-cyborg {
    --auth-bg-gradient:
        radial-gradient(1100px 520px at 50% -18%, rgba(51, 181, 229, 0.18), transparent 62%),
        radial-gradient(780px 430px at 85% 105%, rgba(0, 138, 184, 0.14), transparent 68%),
        linear-gradient(140deg, #030303 0%, #060606 45%, #0a1018 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(51, 181, 229, 0.45), rgba(0, 138, 184, 0.15));
    --auth-glow-b: linear-gradient(120deg, rgba(0, 138, 184, 0.35), rgba(51, 181, 229, 0.12));
    --auth-field-shell-bg: #151a22;
    --auth-field-shell-border: rgba(51, 181, 229, 0.18);
    --auth-field-shell-border-bottom: rgba(51, 181, 229, 0.55);
    --auth-field-shell-hover-bg: #1a212c;
    --auth-field-shell-focus-bg: #1e2733;
    --auth-field-shell-focus-border: rgba(51, 181, 229, 0.7);
    --auth-field-shell-focus-bottom: #33b5e5;
    --auth-input-text: #e8f4fa;
    --auth-input-placeholder: rgba(160, 190, 210, 0.55);
    --auth-icon: rgba(150, 200, 220, 0.85);
    --auth-accent-a: #008ab8;
    --auth-accent-b: #006688;
    --auth-accent-a-hover: #009ccc;
    --auth-accent-b-hover: #007799;
    --auth-checkbox: #33b5e5;
}

/* ===== darkly ===== */
html.theme-darkly {
    --auth-bg-gradient:
        radial-gradient(1000px 500px at 50% -15%, rgba(0, 188, 140, 0.16), transparent 62%),
        radial-gradient(700px 420px at 10% 100%, rgba(55, 90, 127, 0.18), transparent 68%),
        linear-gradient(140deg, #151515 0%, #222222 50%, #1a2530 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(0, 188, 140, 0.42), rgba(55, 90, 127, 0.18));
    --auth-glow-b: linear-gradient(120deg, rgba(55, 90, 127, 0.38), rgba(0, 188, 140, 0.12));
    --auth-card-top: rgba(30, 40, 52, 0.92);
    --auth-card-bottom: rgba(22, 28, 36, 0.88);
    --auth-card-border: rgba(0, 188, 140, 0.28);
    --auth-title-shadow: 0 2px 12px rgba(0, 188, 140, 0.2);
    --auth-field-shell-bg: #1a222c;
    --auth-field-shell-border: rgba(0, 188, 140, 0.18);
    --auth-field-shell-border-bottom: rgba(0, 188, 140, 0.5);
    --auth-field-shell-hover-bg: #202a36;
    --auth-field-shell-focus-bg: #243140;
    --auth-field-shell-focus-bottom: #00bc8c;
    --auth-field-shell-focus-border: rgba(0, 188, 140, 0.75);
    --auth-input-text: #e8f5f0;
    --auth-input-placeholder: rgba(150, 190, 175, 0.55);
    --auth-icon: rgba(140, 200, 180, 0.85);
    --auth-accent-a: #375a7f;
    --auth-accent-b: #00bc8c;
    --auth-accent-a-hover: #426992;
    --auth-accent-b-hover: #00d4a0;
    --auth-checkbox: #00bc8c;
}

/* ===== slate ===== */
html.theme-slate {
    --auth-bg-gradient:
        radial-gradient(1000px 500px at 50% -15%, rgba(187, 191, 194, 0.12), transparent 62%),
        radial-gradient(700px 420px at 90% 100%, rgba(117, 123, 130, 0.16), transparent 68%),
        linear-gradient(140deg, #1f2226 0%, #272b30 50%, #2f3439 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(187, 191, 194, 0.35), rgba(117, 123, 130, 0.15));
    --auth-glow-b: linear-gradient(120deg, rgba(117, 123, 130, 0.32), rgba(85, 91, 97, 0.12));
    --auth-card-top: rgba(42, 46, 51, 0.94);
    --auth-card-bottom: rgba(33, 37, 41, 0.9);
    --auth-card-border: rgba(187, 191, 194, 0.24);
    --auth-title-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    /* fields: neutral slate (not blue/navy from default theme) */
    --auth-field-shell-bg: #3a3f45;
    --auth-field-shell-border: rgba(210, 215, 220, 0.14);
    --auth-field-shell-border-bottom: rgba(127, 200, 170, 0.55);
    --auth-field-shell-hover-bg: #42484e;
    --auth-field-shell-focus-bg: #484e55;
    --auth-field-shell-focus-border: rgba(127, 200, 170, 0.55);
    --auth-field-shell-focus-bottom: #7fc8aa;
    --auth-icon: rgba(198, 205, 212, 0.88);
    --auth-input-text: #f2f4f6;
    --auth-input-placeholder: rgba(186, 193, 200, 0.58);
    --auth-toggle: #c5ccd3;
    --auth-remember: rgba(198, 205, 212, 0.82);
    --auth-accent-a: #6d757d;
    --auth-accent-b: #525960;
    --auth-accent-a-hover: #7d858d;
    --auth-accent-b-hover: #5f666e;
    --auth-checkbox: #7fc8aa;
    --auth-submit-shadow: 0 6px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --auth-submit-shadow-hover: 0 9px 18px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* ===== cerulean ===== */
html.theme-cerulean {
    --auth-bg-gradient:
        radial-gradient(1000px 500px at 50% -15%, rgba(54, 155, 215, 0.22), transparent 62%),
        radial-gradient(700px 420px at 15% 100%, rgba(97, 176, 223, 0.18), transparent 68%),
        linear-gradient(140deg, #e8f4fc 0%, #f5fafd 45%, #ffffff 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(54, 155, 215, 0.35), rgba(97, 176, 223, 0.15));
    --auth-glow-b: linear-gradient(120deg, rgba(97, 176, 223, 0.28), rgba(54, 155, 215, 0.1));
    --auth-text: #445566;
    --auth-title: #2a5a7a;
    --auth-title-shadow: 0 2px 10px rgba(54, 155, 215, 0.18);
    --auth-danger: #c0392b;
    --auth-card-top: rgba(255, 255, 255, 0.94);
    --auth-card-bottom: rgba(245, 250, 255, 0.9);
    --auth-card-border: rgba(54, 155, 215, 0.28);
    --auth-card-shadow: 0 20px 50px rgba(54, 155, 215, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --auth-field-shell-bg: rgba(255, 255, 255, 0.82);
    --auth-field-shell-border: rgba(54, 155, 215, 0.22);
    --auth-field-shell-border-bottom: rgba(54, 155, 215, 0.45);
    --auth-field-shell-hover-bg: rgba(255, 255, 255, 0.95);
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(54, 155, 215, 0.75);
    --auth-field-shell-focus-bottom: #368bd7;
    --auth-icon: rgba(54, 139, 215, 0.85);
    --auth-input-text: #334455;
    --auth-input-placeholder: rgba(85, 85, 85, 0.55);
    --auth-toggle: #5a8fc4;
    --auth-toggle-hover-bg: rgba(54, 155, 215, 0.12);
    --auth-toggle-hover: #368bd7;
    --auth-remember: rgba(68, 85, 102, 0.78);
    --auth-accent-a: #369bd7;
    --auth-accent-b: #2a7eb8;
    --auth-accent-a-hover: #4aa8e0;
    --auth-accent-b-hover: #328fc9;
    --auth-checkbox: #368bd7;
    --auth-submit-shadow: 0 6px 14px rgba(54, 155, 215, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    --auth-submit-shadow-hover: 0 9px 18px rgba(54, 155, 215, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ===== classic ===== */
html.theme-classic {
    --auth-bg-gradient:
        radial-gradient(900px 480px at 50% -15%, rgba(0, 116, 204, 0.14), transparent 62%),
        radial-gradient(700px 400px at 10% 100%, rgba(44, 44, 44, 0.08), transparent 68%),
        linear-gradient(140deg, #eef1f4 0%, #f8f9fa 50%, #ffffff 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(0, 116, 204, 0.22), rgba(44, 44, 44, 0.08));
    --auth-glow-b: linear-gradient(120deg, rgba(44, 44, 44, 0.12), rgba(0, 116, 204, 0.08));
    --auth-text: #444;
    --auth-title: #2c2c2c;
    --auth-title-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    --auth-danger: #b94846;
    --auth-card-top: rgba(255, 255, 255, 0.96);
    --auth-card-bottom: rgba(248, 249, 250, 0.92);
    --auth-card-border: rgba(44, 44, 44, 0.12);
    --auth-card-shadow: 0 20px 48px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --auth-field-shell-bg: rgba(255, 255, 255, 0.9);
    --auth-field-shell-border: rgba(0, 0, 0, 0.1);
    --auth-field-shell-border-bottom: rgba(0, 116, 204, 0.45);
    --auth-field-shell-hover-bg: #fff;
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(0, 116, 204, 0.65);
    --auth-field-shell-focus-bottom: #0074cc;
    --auth-icon: rgba(68, 68, 68, 0.75);
    --auth-input-text: #333;
    --auth-input-placeholder: rgba(85, 85, 85, 0.55);
    --auth-toggle: #666;
    --auth-toggle-hover-bg: rgba(0, 116, 204, 0.1);
    --auth-toggle-hover: #0074cc;
    --auth-remember: rgba(68, 68, 68, 0.75);
    --auth-accent-a: #0074cc;
    --auth-accent-b: #005fa3;
    --auth-accent-a-hover: #0088ee;
    --auth-accent-b-hover: #006fbd;
    --auth-checkbox: #0074cc;
    --auth-submit-shadow: 0 6px 14px rgba(0, 116, 204, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --auth-submit-shadow-hover: 0 9px 18px rgba(0, 116, 204, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ===== simplex ===== */
html.theme-simplex {
    --auth-bg-gradient:
        radial-gradient(900px 480px at 50% -15%, rgba(54, 92, 220, 0.14), transparent 62%),
        radial-gradient(700px 400px at 85% 100%, rgba(237, 237, 237, 0.9), transparent 68%),
        linear-gradient(140deg, #e8e8e8 0%, #ededed 50%, #f3f3f3 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(54, 92, 220, 0.2), rgba(243, 243, 243, 0.5));
    --auth-glow-b: linear-gradient(120deg, rgba(51, 51, 51, 0.08), rgba(54, 92, 220, 0.1));
    --auth-text: #444;
    --auth-title: #333;
    --auth-title-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --auth-danger: #d9230f;
    --auth-card-top: rgba(255, 255, 255, 0.96);
    --auth-card-bottom: rgba(247, 247, 247, 0.92);
    --auth-card-border: rgba(51, 51, 51, 0.1);
    --auth-card-shadow: 0 18px 44px rgba(0, 0, 0, 0.08), inset 0 1px 0 #fff;
    --auth-field-shell-bg: rgba(255, 255, 255, 0.92);
    --auth-field-shell-border: rgba(51, 51, 51, 0.12);
    --auth-field-shell-border-bottom: rgba(54, 92, 220, 0.5);
    --auth-field-shell-hover-bg: #fff;
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(54, 92, 220, 0.65);
    --auth-field-shell-focus-bottom: #365cdc;
    --auth-icon: rgba(51, 51, 51, 0.7);
    --auth-input-text: #333;
    --auth-input-placeholder: rgba(85, 85, 85, 0.55);
    --auth-toggle: #555;
    --auth-toggle-hover-bg: rgba(54, 92, 220, 0.1);
    --auth-toggle-hover: #365cdc;
    --auth-remember: rgba(68, 68, 68, 0.75);
    --auth-accent-a: #365cdc;
    --auth-accent-b: #2848a8;
    --auth-accent-a-hover: #4568e8;
    --auth-accent-b-hover: #3054bc;
    --auth-checkbox: #365cdc;
    --auth-submit-shadow: 0 6px 14px rgba(54, 92, 220, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --auth-submit-shadow-hover: 0 9px 18px rgba(54, 92, 220, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ===== lumen ===== */
html.theme-lumen {
    --auth-bg-gradient:
        radial-gradient(900px 480px at 50% -15%, rgba(21, 140, 186, 0.16), transparent 62%),
        radial-gradient(700px 400px at 15% 100%, rgba(255, 153, 0, 0.08), transparent 68%),
        linear-gradient(140deg, #fafbfc 0%, #ffffff 50%, #f6f8fa 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(21, 140, 186, 0.2), rgba(255, 153, 0, 0.08));
    --auth-glow-b: linear-gradient(120deg, rgba(255, 153, 0, 0.1), rgba(21, 140, 186, 0.08));
    --auth-text: #444;
    --auth-title: #222;
    --auth-title-shadow: none;
    --auth-danger: #e74c3c;
    --auth-card-top: rgba(255, 255, 255, 0.98);
    --auth-card-bottom: rgba(252, 253, 254, 0.95);
    --auth-card-border: rgba(21, 140, 186, 0.18);
    --auth-card-shadow: 0 16px 40px rgba(21, 140, 186, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06);
    --auth-field-shell-bg: rgba(255, 255, 255, 0.95);
    --auth-field-shell-border: rgba(0, 0, 0, 0.08);
    --auth-field-shell-border-bottom: rgba(21, 140, 186, 0.42);
    --auth-field-shell-hover-bg: #fff;
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(21, 140, 186, 0.6);
    --auth-field-shell-focus-bottom: #158cba;
    --auth-icon: rgba(21, 140, 186, 0.8);
    --auth-input-text: #333;
    --auth-input-placeholder: rgba(85, 85, 85, 0.5);
    --auth-toggle: #158cba;
    --auth-toggle-hover-bg: rgba(21, 140, 186, 0.1);
    --auth-toggle-hover: #0f7196;
    --auth-remember: rgba(68, 68, 68, 0.72);
    --auth-accent-a: #158cba;
    --auth-accent-b: #ff9900;
    --auth-accent-a-hover: #19a0d4;
    --auth-accent-b-hover: #ffaa22;
    --auth-checkbox: #158cba;
    --auth-submit-shadow: 0 4px 12px rgba(21, 140, 186, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    --auth-submit-shadow-hover: 0 8px 16px rgba(21, 140, 186, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ===== spacelab ===== */
html.theme-spacelab {
    --auth-bg-gradient:
        radial-gradient(900px 480px at 50% -15%, rgba(65, 118, 196, 0.14), transparent 62%),
        radial-gradient(700px 400px at 85% 100%, rgba(247, 247, 247, 0.9), transparent 68%),
        linear-gradient(140deg, #f2f4f7 0%, #ffffff 50%, #f7f7f7 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(65, 118, 196, 0.18), rgba(234, 234, 234, 0.6));
    --auth-glow-b: linear-gradient(120deg, rgba(51, 51, 51, 0.06), rgba(65, 118, 196, 0.1));
    --auth-text: #444;
    --auth-title: #333;
    --auth-title-shadow: 0 1px 6px rgba(65, 118, 196, 0.12);
    --auth-danger: #d9534f;
    --auth-card-top: rgba(255, 255, 255, 0.96);
    --auth-card-bottom: rgba(249, 250, 252, 0.92);
    --auth-card-border: rgba(65, 118, 196, 0.2);
    --auth-card-shadow: 0 18px 42px rgba(65, 118, 196, 0.1), inset 0 1px 0 #fff;
    --auth-field-shell-bg: rgba(255, 255, 255, 0.92);
    --auth-field-shell-border: rgba(0, 0, 0, 0.08);
    --auth-field-shell-border-bottom: rgba(65, 118, 196, 0.42);
    --auth-field-shell-hover-bg: #fff;
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(65, 118, 196, 0.62);
    --auth-field-shell-focus-bottom: #4176c4;
    --auth-icon: rgba(65, 118, 196, 0.8);
    --auth-input-text: #333;
    --auth-input-placeholder: rgba(85, 85, 85, 0.55);
    --auth-toggle: #4176c4;
    --auth-toggle-hover-bg: rgba(65, 118, 196, 0.1);
    --auth-toggle-hover: #335fa8;
    --auth-remember: rgba(68, 68, 68, 0.75);
    --auth-accent-a: #4176c4;
    --auth-accent-b: #335fa8;
    --auth-accent-a-hover: #5085d0;
    --auth-accent-b-hover: #3a6ab4;
    --auth-checkbox: #4176c4;
    --auth-submit-shadow: 0 6px 14px rgba(65, 118, 196, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --auth-submit-shadow-hover: 0 9px 18px rgba(65, 118, 196, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ===== united ===== */
html.theme-united {
    --auth-bg-gradient:
        radial-gradient(900px 480px at 50% -15%, rgba(221, 72, 20, 0.16), transparent 62%),
        radial-gradient(700px 400px at 15% 100%, rgba(206, 66, 19, 0.1), transparent 68%),
        linear-gradient(140deg, #fff8f5 0%, #ffffff 50%, #fff5f0 100%);
    --auth-glow-a: linear-gradient(120deg, rgba(221, 72, 20, 0.22), rgba(255, 200, 170, 0.2));
    --auth-glow-b: linear-gradient(120deg, rgba(206, 66, 19, 0.15), rgba(221, 92, 20, 0.08));
    --auth-text: #444;
    --auth-title: #8a2f0c;
    --auth-title-shadow: 0 2px 10px rgba(221, 72, 20, 0.15);
    --auth-danger: #c0392b;
    --auth-card-top: rgba(255, 255, 255, 0.96);
    --auth-card-bottom: rgba(255, 248, 245, 0.92);
    --auth-card-border: rgba(221, 72, 20, 0.22);
    --auth-card-shadow: 0 20px 48px rgba(221, 72, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    --auth-field-shell-bg: rgba(255, 255, 255, 0.92);
    --auth-field-shell-border: rgba(221, 72, 20, 0.15);
    --auth-field-shell-border-bottom: rgba(221, 72, 20, 0.45);
    --auth-field-shell-hover-bg: #fff;
    --auth-field-shell-focus-bg: #fff;
    --auth-field-shell-focus-border: rgba(221, 72, 20, 0.65);
    --auth-field-shell-focus-bottom: #dd4814;
    --auth-icon: rgba(221, 72, 20, 0.8);
    --auth-input-text: #333;
    --auth-input-placeholder: rgba(85, 85, 85, 0.55);
    --auth-toggle: #dd4814;
    --auth-toggle-hover-bg: rgba(221, 72, 20, 0.1);
    --auth-toggle-hover: #97310e;
    --auth-remember: rgba(68, 68, 68, 0.75);
    --auth-accent-a: #dd4814;
    --auth-accent-b: #ce4213;
    --auth-accent-a-hover: #e85520;
    --auth-accent-b-hover: #d44a15;
    --auth-checkbox: #dd4814;
    --auth-submit-shadow: 0 6px 14px rgba(221, 72, 20, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    --auth-submit-shadow-hover: 0 9px 18px rgba(221, 72, 20, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.auth-field-hint{margin:6px 2px 0;font-size:12px;line-height:1.35;opacity:.75}

.auth-field-error {
    margin: 6px 2px 0;
    min-height: 0;
    font-size: 12px;
    line-height: 1.35;
    color: #e74c3c;
}
.auth-field-error:empty {
    display: none;
}
.field-control.is-invalid {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 1px rgba(231, 76, 60, 0.35);
}


/* ===== Server status notch (metrics-api) ===== */
.auth-title {
    margin-bottom: 14px;
}
.auth-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 0 22px;
    min-height: 3px;
}
.auth-status-notch {
    width: 60px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #94a3b8, #64748b);
    box-shadow: 0 0 8px rgba(100, 116, 139, 0.35);
    transition: background 0.4s ease, box-shadow 0.4s ease, width 0.3s ease;
}
.auth-status.is-checking .auth-status-notch {
    background: linear-gradient(90deg, #94a3b8, #64748b);
    animation: auth-status-pulse 1.2s ease-in-out infinite;
}
.auth-status.is-available .auth-status-notch {
    background: linear-gradient(90deg, #4ade80, #16a34a);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}
.auth-status.is-unavailable .auth-status-notch {
    background: linear-gradient(90deg, #fca5a5, #ef4444);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}
@keyframes auth-status-pulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 1; }
}
.auth-status-details {
    margin-top: 10px;
    width: 100%;
    text-align: center;
}
.auth-status-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 6px;
}
.auth-status-line .auth-status-dot {
    display: none;
}
.auth-status-line-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.auth-status-line-title::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 4px currentColor;
    flex-shrink: 0;
}
.auth-status-line.is-danger .auth-status-line-title {
    color: #ef4444;
}
.auth-status-line-dates {
    font-size: 10px;
    font-weight: 400;
    color: rgba(239, 68, 68, 0.8);
    letter-spacing: 0.2px;
}
#login-form.is-server-blocked,
#register-form.is-server-blocked {
    opacity: 0.55;
}

#login-form.is-server-blocked input,
#login-form.is-server-blocked button,
#login-form.is-server-blocked select,
#login-form.is-server-blocked textarea,
#login-form.is-server-blocked .field-shell,
#login-form.is-server-blocked .captcha-image-btn,
#login-form.is-server-blocked .auth-remember,
#login-form.is-server-blocked .auth-forgot-link,
#login-form.is-server-blocked .captcha-field,
#forgot-form.is-server-blocked input,
#forgot-form.is-server-blocked button,
#forgot-form.is-server-blocked .field-shell,
#forgot-form.is-server-blocked .captcha-image-btn,
#forgot-form.is-server-blocked .captcha-field,
#register-form.is-server-blocked input,
#register-form.is-server-blocked button,
#register-form.is-server-blocked select,
#register-form.is-server-blocked textarea,
#register-form.is-server-blocked .field-shell,
#register-form.is-server-blocked .captcha-image-btn,
#register-form.is-server-blocked .auth-remember,
#register-form.is-server-blocked .captcha-field {
    cursor: not-allowed !important;
    pointer-events: auto;
}
body.theme-dark .auth-status.is-available .auth-status-notch,
html.theme-dark .auth-status.is-available .auth-status-notch {
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.45);
}
body.theme-dark .auth-status-line.is-danger .auth-status-line-title,
html.theme-dark .auth-status-line.is-danger .auth-status-line-title {
    color: #f87171;
}


/* checkbox fallbacks without color-mix */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
    .auth-remember-box {
        border-color: rgba(180, 190, 200, 0.45);
        background: rgba(40, 48, 58, 0.55);
    }
    .auth-remember input:checked + .auth-remember-box {
        background: var(--auth-checkbox);
        box-shadow: 0 0 0 3px rgba(127, 200, 170, 0.22);
    }
}


/* ===== Anti Brute Force / login error modals (chromatography-like) ===== */
.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(4px);
}
.auth-modal-backdrop[hidden] {
    display: none !important;
}
.auth-modal {
    width: min(380px, 100%);
    border-radius: 28px;
    padding: 32px 28px 28px;
    background: linear-gradient(165deg, #ffffff 0%, #fff5f5 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    text-align: center;
    color: #334155;
}
.auth-modal.is-warn {
    background: linear-gradient(165deg, #ffffff 0%, #fff8f0 100%);
}
.auth-modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 8px 22px rgba(220, 53, 69, 0.4);
    background: linear-gradient(145deg, #dc3545, #c82333);
}
.auth-modal.is-warn .auth-modal-icon {
    background: linear-gradient(145deg, #f59e0b, #d97706);
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.4);
}
.auth-modal-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-modal-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 800;
    color: #1f2937;
    letter-spacing: 0.2px;
}
.auth-modal-banner {
    margin: 0 0 20px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 600;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}
.auth-modal.is-warn .auth-modal-banner {
    color: #c2410c;
    background: #fff7ed;
    border-color: #fed7aa;
}
.auth-modal-timer {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto 24px;
    padding: 14px 22px;
    border-radius: 16px;
    border: 2px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.3px;
}
.auth-modal.is-warn .auth-modal-timer {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
    font-size: 16px;
}
.auth-modal-timer svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.auth-modal-timer.is-compact {
    font-size: 20px;
}
.auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.auth-modal-btn {
    width: 100%;
    border: 0;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.4px;
    cursor: pointer;
    color: #fff;
    background: #94a3b8;
}
.auth-modal-btn.is-primary {
    background: #3b82f6;
    box-shadow: 0 8px 18px rgba(59, 130, 246, 0.35);
}
.auth-modal-btn:disabled {
    cursor: wait;
    opacity: 0.9;
}
html.theme-dark .auth-modal,
html.theme-cyborg .auth-modal,
html.theme-darkly .auth-modal,
html.theme-slate .auth-modal {
    background: linear-gradient(165deg, #2a3038 0%, #1f242b 100%);
    color: #e5e7eb;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
html.theme-dark .auth-modal-title,
html.theme-cyborg .auth-modal-title,
html.theme-darkly .auth-modal-title,
html.theme-slate .auth-modal-title {
    color: #f3f4f6;
}
html.theme-dark .auth-modal-banner,
html.theme-cyborg .auth-modal-banner,
html.theme-darkly .auth-modal-banner,
html.theme-slate .auth-modal-banner {
    background: rgba(220, 53, 69, 0.14);
    border-color: rgba(220, 53, 69, 0.35);
    color: #fca5a5;
}
html.theme-dark .auth-modal.is-warn .auth-modal-banner,
html.theme-cyborg .auth-modal.is-warn .auth-modal-banner,
html.theme-darkly .auth-modal.is-warn .auth-modal-banner,
html.theme-slate .auth-modal.is-warn .auth-modal-banner {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fdba74;
}
html.theme-dark .auth-modal-timer,
html.theme-cyborg .auth-modal-timer,
html.theme-darkly .auth-modal-timer,
html.theme-slate .auth-modal-timer {
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.4);
    color: #fca5a5;
}
html.theme-dark .auth-modal.is-warn .auth-modal-timer,
html.theme-cyborg .auth-modal.is-warn .auth-modal-timer,
html.theme-darkly .auth-modal.is-warn .auth-modal-timer,
html.theme-slate .auth-modal.is-warn .auth-modal-timer {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.4);
    color: #fdba74;
}


/* Maintenance: form stays usable for developer login */
.auth-status.is-maintenance .auth-status-notch {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}
.auth-status.is-maintenance.is-unavailable .auth-status-notch {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}


/* Hidden developer manual login (revealed by 5 clicks on status notch during maintenance) */
.auth-service-login {
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: rgba(180, 190, 200, 0.55);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    padding: 2px 6px;
}
.auth-service-login:hover,
.auth-service-login:focus-visible {
    color: rgba(220, 230, 240, 0.9);
    outline: none;
}
.auth-service-login[hidden] {
    display: none !important;
}
html.theme-light .auth-service-login {
    color: rgba(80, 90, 100, 0.45);
}
html.theme-light .auth-service-login:hover,
html.theme-light .auth-service-login:focus-visible {
    color: rgba(40, 50, 60, 0.85);
}
.auth-status.is-service-unlock .auth-status-notch {
    box-shadow: 0 0 10px rgba(127, 200, 170, 0.55);
}
