:root {
    --cs-brand-primary: #0f172a;
    --cs-brand-secondary: #1e3a8a;
    --cs-brand-accent: #f59e0b;
    --cs-login-ink: #172033;
    --cs-login-muted: #64748b;
    --cs-login-line: #dbe4ef;
    --cs-login-soft: #f4f7fb;
    --cs-login-panel: #ffffff;
    --cs-login-danger: #991b1b;
    --cs-login-ok: #065f46;
    --cs-login-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body.cs-login-body {
    margin: 0;
    min-height: 100vh;
    padding: clamp(18px, 4vw, 54px);
    display: grid;
    place-items: center;
    color: var(--cs-login-ink);
    background:
        radial-gradient(circle at 12% 12%, color-mix(in srgb, var(--cs-brand-accent) 17%, transparent), transparent 36%),
        linear-gradient(135deg, var(--cs-brand-primary) 0%, var(--cs-brand-secondary) 67%, color-mix(in srgb, var(--cs-brand-secondary) 70%, #0f766e) 100%);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.cs-login-shell {
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: minmax(280px, .8fr) minmax(390px, 1.2fr);
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,.28);
    background: var(--cs-login-panel);
    box-shadow: var(--cs-login-shadow);
}

.cs-login-brand {
    padding: clamp(30px, 5vw, 54px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
    color: #fff;
    background: linear-gradient(145deg, color-mix(in srgb, var(--cs-brand-primary) 92%, #000) 0%, var(--cs-brand-secondary) 100%);
}

.cs-login-brandmark {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -.02em;
}

.cs-login-brandmark-badge {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    flex: 0 0 52px;
    border-radius: 16px;
    background: #fff;
    color: var(--cs-brand-secondary);
    font-size: 1.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}

.cs-login-brand h1 {
    margin: 0;
    font-size: clamp(2.1rem, 5vw, 3.8rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.cs-login-brand p {
    margin: 16px 0 0;
    max-width: 32rem;
    color: rgba(255,255,255,.84);
    font-size: 1rem;
    line-height: 1.55;
}

.cs-login-brand-footer {
    display: grid;
    gap: 10px;
    color: rgba(255,255,255,.78);
    font-size: .9rem;
}

.cs-login-brand-footer a {
    width: fit-content;
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.45);
}

.cs-login-panel {
    padding: clamp(30px, 5vw, 58px);
    background: #fff;
}

.cs-login-panel-header {
    margin-bottom: 24px;
}

.cs-security-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    color: var(--cs-brand-secondary);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.cs-security-kicker::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22,163,74,.12);
}

.cs-login-panel h2 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.cs-login-subtitle {
    margin: 10px 0 0;
    color: var(--cs-login-muted);
    line-height: 1.5;
}

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

.cs-login-field {
    display: grid;
    gap: 7px;
}

.cs-login-field label,
.cs-session-timeout legend {
    color: #334155;
    font-weight: 800;
    font-size: .92rem;
}

.cs-login-field input,
.cs-session-timeout input {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: var(--cs-login-ink);
    font: inherit;
    font-size: 1rem;
}

.cs-login-field input:focus,
.cs-session-timeout input:focus {
    outline: 3px solid color-mix(in srgb, var(--cs-brand-secondary) 18%, transparent);
    border-color: var(--cs-brand-secondary);
    background: #fff;
}

.cs-login-button {
    min-height: 54px;
    margin-top: 4px;
    border: 0;
    border-radius: 13px;
    padding: 12px 18px;
    background: var(--cs-brand-accent);
    color: #111827;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--cs-brand-accent) 28%, transparent);
}

.cs-login-button:hover { filter: brightness(1.02); }
.cs-login-button:focus-visible { outline: 3px solid color-mix(in srgb, var(--cs-brand-accent) 35%, transparent); outline-offset: 3px; }
.cs-login-button:disabled { opacity: .65; cursor: wait; }

.cs-login-message {
    display: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--cs-login-line);
    font-size: .94rem;
    font-weight: 750;
}

.cs-login-message.show { display: block; }
.cs-login-message.error { color: var(--cs-login-danger); background: #fef2f2; border-color: #fecaca; }
.cs-login-message.ok { color: var(--cs-login-ok); background: #ecfdf5; border-color: #a7f3d0; }
.cs-login-message.info { color: #334155; background: #f8fafc; }

.cs-login-secure-note {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--cs-login-line);
    color: var(--cs-login-muted);
    font-size: .86rem;
    line-height: 1.5;
}

.cs-session-timeout {
    margin: 4px 0 0;
    padding: 16px;
    border: 1px solid var(--cs-login-line);
    border-radius: 14px;
    background: var(--cs-login-soft);
}

.cs-session-timeout legend { padding: 0 6px; }
.cs-session-timeout p { margin: 0 0 12px; color: var(--cs-login-muted); font-size: .86rem; line-height: 1.45; }
.cs-session-timeout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cs-session-timeout-grid label { display: grid; gap: 6px; color: #475569; font-size: .82rem; font-weight: 800; }

.cs-qr-wrap {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 18px;
    margin-bottom: 18px;
    border: 1px solid var(--cs-login-line);
    border-radius: 16px;
    background: var(--cs-login-soft);
}

.cs-qr-wrap img {
    max-width: min(250px, 100%);
    height: auto;
    border-radius: 10px;
    background: #fff;
}

.cs-secret-code {
    display: block;
    max-width: 100%;
    padding: 10px 12px;
    overflow-wrap: anywhere;
    border-radius: 10px;
    background: #eef2f7;
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .88rem;
}

.cs-login-error-text {
    min-height: 22px;
    color: var(--cs-login-danger);
    font-size: .9rem;
    font-weight: 750;
}

@media (max-width: 760px) {
    body.cs-login-body { padding: 12px; place-items: start center; }
    .cs-login-shell { grid-template-columns: 1fr; border-radius: 20px; }
    .cs-login-brand { padding: 24px; gap: 20px; }
    .cs-login-brand h1 { font-size: 2.1rem; }
    .cs-login-brand-footer { display: none; }
    .cs-login-panel { padding: 26px 22px 30px; }
}

@media (max-width: 460px) {
    .cs-session-timeout-grid { grid-template-columns: 1fr; }
}
