html,
body.csl-login-body {
    min-height: 100%;
    margin: 0;
    background: var(--csl-bg, #070b14);
}

body.csl-login-body {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #e5edf8;
}

.csl-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 18px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--csl-accent, #4f8cff) 38%, transparent), transparent 28%),
        radial-gradient(circle at 78% 78%, rgba(148, 163, 184, 0.18), transparent 32%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
        var(--csl-bg-image, none),
        var(--csl-bg, #070b14);
    background-size: cover;
    background-position: center;
    box-sizing: border-box;
}

.csl-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.72), transparent 82%);
    pointer-events: none;
}

.csl-card {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.14);
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
        color-mix(in srgb, var(--csl-panel, #0f172a) 92%, #ffffff 8%);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
    box-sizing: border-box;
}

.csl-card--compact {
    width: min(100%, 520px);
}

.csl-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.csl-logo,
.csl-logo-mark {
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 18px;
}

.csl-logo {
    object-fit: contain;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
}

.csl-logo-mark {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--csl-accent, #4f8cff), rgba(255, 255, 255, 0.18));
    color: #fff;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.04em;
    box-shadow: 0 16px 36px color-mix(in srgb, var(--csl-accent, #4f8cff) 34%, transparent);
}

.csl-brand h1 {
    margin: 0;
    font-size: clamp(24px, 3.8vw, 34px);
    line-height: 1.04;
    letter-spacing: -0.045em;
    color: #f8fafc;
}

.csl-brand p {
    margin: 8px 0 0;
    color: rgba(226, 232, 240, 0.72);
    font-size: 14px;
    line-height: 1.5;
}

.csl-form {
    display: grid;
    gap: 16px;
}

.csl-field {
    display: grid;
    gap: 8px;
}

.csl-field span,
.csl-check span {
    color: rgba(226, 232, 240, 0.86);
    font-size: 13px;
    font-weight: 650;
}

.csl-field input {
    width: 100%;
    height: 52px;
    padding: 0 15px;
    border: 1px solid rgba(226, 232, 240, 0.14);
    border-radius: 16px;
    outline: none;
    background: rgba(2, 6, 23, 0.58);
    color: #f8fafc;
    font: inherit;
    box-sizing: border-box;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.csl-field input:focus {
    border-color: color-mix(in srgb, var(--csl-accent, #4f8cff) 82%, #ffffff 18%);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--csl-accent, #4f8cff) 20%, transparent);
    background: rgba(2, 6, 23, 0.78);
}

.csl-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 2px;
}

.csl-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.csl-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--csl-accent, #4f8cff);
}

.csl-small-link,
.csl-link-button {
    color: color-mix(in srgb, var(--csl-accent, #4f8cff) 72%, #ffffff 28%);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.csl-small-link:hover,
.csl-link-button:hover {
    text-decoration: underline;
}

.csl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    width: 100%;
    max-width: 100%;
    padding: 0 18px;
    box-sizing: border-box;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--csl-accent, #4f8cff), color-mix(in srgb, var(--csl-accent, #4f8cff) 70%, #111827 30%));
    color: #fff;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 18px 38px color-mix(in srgb, var(--csl-accent, #4f8cff) 26%, transparent);
    transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
}

.csl-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    text-decoration: none;
}

.csl-button:active {
    transform: translateY(0);
}

.csl-actions {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    margin-top: 18px;
    box-sizing: border-box;
}

.csl-actions > .csl-button,
.csl-actions > .csl-link-button {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.csl-link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
}

.csl-notice {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
}

.csl-notice--error {
    border: 1px solid rgba(248, 113, 113, 0.26);
    background: rgba(127, 29, 29, 0.32);
    color: #fecaca;
}

.csl-notice--success {
    border: 1px solid rgba(74, 222, 128, 0.28);
    background: rgba(20, 83, 45, 0.26);
    color: #bbf7d0;
}

.csl-footer-text {
    margin: 20px 0 0;
    color: rgba(226, 232, 240, 0.52);
    text-align: center;
    font-size: 12px;
}

.csl-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .csl-wrap {
        align-items: stretch;
        padding: 18px;
    }

    .csl-card {
        align-self: center;
        padding: 22px;
        border-radius: 24px;
    }

    .csl-brand {
        align-items: flex-start;
        gap: 13px;
        margin-bottom: 22px;
    }

    .csl-logo,
    .csl-logo-mark {
        width: 50px;
        height: 50px;
    }

    .csl-logo {
        border-radius: 0;
    }

    .csl-logo-mark {
        border-radius: 16px;
    }

    .csl-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

/* Theme-specific refinements */
.csl-theme-clean_light {
    color: #0f172a;
}

.csl-theme-clean_light.csl-wrap {
    background:
        radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--csl-accent, #2563eb) 20%, transparent), transparent 30%),
        radial-gradient(circle at 84% 78%, rgba(15, 23, 42, 0.08), transparent 34%),
        var(--csl-bg-image, none),
        var(--csl-bg, #eef2f7);
}

.csl-theme-clean_light.csl-wrap::before {
    background:
        linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
}

.csl-theme-clean_light .csl-card {
    border-color: rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.14);
}

.csl-theme-clean_light .csl-brand h1,
.csl-theme-clean_light .csl-field input {
    color: #0f172a;
}

.csl-theme-clean_light .csl-brand p,
.csl-theme-clean_light .csl-field span,
.csl-theme-clean_light .csl-check span {
    color: rgba(15, 23, 42, 0.72);
}

.csl-theme-clean_light .csl-field input {
    border-color: rgba(15, 23, 42, 0.14);
    background: rgba(255, 255, 255, 0.82);
}

.csl-theme-clean_light .csl-field input:focus {
    background: #fff;
}

.csl-theme-clean_light .csl-link-button {
    background: rgba(15, 23, 42, 0.055);
}

.csl-theme-clean_light .csl-footer-text {
    color: rgba(15, 23, 42, 0.50);
}

.csl-theme-blue_command .csl-card {
    border-color: rgba(56, 189, 248, 0.22);
    box-shadow: 0 28px 92px rgba(8, 47, 73, 0.58);
}

.csl-theme-blue_command .csl-wrap::before,
.csl-theme-blue_command.csl-wrap::before {
    background:
        linear-gradient(rgba(56, 189, 248, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.045) 1px, transparent 1px);
}

.csl-theme-red_security .csl-card {
    border-color: rgba(248, 113, 113, 0.20);
    box-shadow: 0 28px 92px rgba(127, 29, 29, 0.42);
}

.csl-theme-red_security .csl-logo-mark {
    box-shadow: 0 16px 36px rgba(239, 68, 68, 0.30);
}

.csl-theme-intelligence .csl-card,
.csl-theme-terminal .csl-card {
    overflow: hidden;
}

.csl-theme-intelligence .csl-card::before,
.csl-theme-terminal .csl-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--csl-accent, #c6a15b), transparent);
    opacity: 0.88;
}

.csl-theme-intelligence .csl-card {
    border-color: rgba(198, 161, 91, 0.22);
    box-shadow: 0 28px 92px rgba(0, 0, 0, 0.66);
}

.csl-theme-intelligence .csl-brand h1 {
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.csl-theme-terminal.csl-wrap::before {
    background:
        linear-gradient(rgba(34, 197, 94, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 197, 94, 0.055) 1px, transparent 1px);
}

.csl-theme-terminal .csl-card {
    border-color: rgba(34, 197, 94, 0.22);
    box-shadow: 0 28px 92px rgba(20, 83, 45, 0.34);
}

.csl-theme-terminal .csl-brand h1,
.csl-theme-terminal .csl-field span,
.csl-theme-terminal .csl-check span,
.csl-theme-terminal .csl-footer-text {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.csl-section-head {
    margin: -4px 0 18px;
}

.csl-section-head h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.csl-section-head p,
.csl-help-text,
.csl-backline {
    color: rgba(226, 232, 240, 0.68);
    font-size: 13px;
    line-height: 1.55;
}

.csl-section-head p {
    margin: 8px 0 0;
}

.csl-help-text {
    margin: -4px 0 0;
}

.csl-backline {
    margin: 16px 0 0;
    text-align: center;
}

.csl-theme-clean_light .csl-section-head h2 {
    color: #0f172a;
}

.csl-theme-clean_light .csl-section-head p,
.csl-theme-clean_light .csl-help-text,
.csl-theme-clean_light .csl-backline {
    color: rgba(15, 23, 42, 0.62);
}
