.auth {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .34);
}

.login {
    display: grid;
    min-height: 100vh;
    padding: 24px;
    place-items: center;
    background:
        radial-gradient(circle at 22% 18%, var(--body-glow-1), transparent 26%),
        radial-gradient(circle at 78% 82%, var(--body-glow-2), transparent 28%),
        var(--bg);
}

.auth {
    position: relative;
    overflow: hidden;
    width: min(100%, 430px);
    padding: 26px;
}

.auth::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--brand-yellow));
}

.auth .brand {
    justify-items: center;
    margin-bottom: 24px;
    text-align: center;
}

.partner-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.partner-logos img {
    height: 34px;
    object-fit: contain;
}

.partner-x {
    color: var(--muted);
    font-size: 14px;
    opacity: .5;
}

.auth .brand-logo {
    width: min(100%, 320px);
    max-height: 96px;
    object-position: center;
}

.auth .brand small {
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.auth h1 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
}

.auth .muted {
    text-align: center;
    margin: 0 0 22px;
    font-size: 13px;
    color: var(--muted);
}

/* ── Login fields ──────────────────────────────── */

.login-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 14px;
}

.login-field .field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.login-field .field-label svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.login-field .field-wrap {
    position: relative;
}

.login-field input {
    width: 100%;
    border: 1.5px solid var(--line-strong);
    background: var(--surface-soft);
    color: var(--ink);
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .2s, box-shadow .2s;
}

.login-field input.has-toggle {
    padding-right: 46px;
}

.login-field input:focus {
    border-color: rgba(225, 29, 72, .5);
    box-shadow: 0 0 0 3px rgba(225, 29, 72, .1);
    outline: none;
}

.login-field input.field-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .1);
}

.login-field input.field-ok {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .1);
}

.login-field .field-msg {
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
    display: none;
}

.login-field .field-msg.visible {
    display: flex;
    align-items: center;
    gap: 5px;
}

.login-field .field-msg.error { color: #f87171; }
.login-field .field-msg.success { color: #34d399; }

.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-pw:hover { color: var(--ink); }

.caps-warn {
    background: rgba(251, 191, 36, .12);
    border: 1px solid rgba(251, 191, 36, .3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fbbf24;
    display: none;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.caps-warn.visible { display: flex; }

.btn-login {
    margin-top: 8px;
    width: 100%;
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover { opacity: .9; }
.btn-login:active { transform: scale(.98); }
.btn-login:disabled { opacity: .65; cursor: not-allowed; }

.btn-login .spinner {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(255, 255, 255, .3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: none;
}

.btn-login.loading .spinner { display: block; }
.btn-login.loading .btn-text { display: none; }

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: color .15s;
}

.login-footer a:hover { color: var(--primary); }

.login-restricted {
    text-align: center;
    font-size: 10px;
    font-weight: 500;
    color: var(--muted);
    opacity: .5;
    margin-top: 12px;
    letter-spacing: .5px;
}

.alert.error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #f87171;
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-credit {
    color: var(--muted);
    font-size: 11px;
    text-align: center;
    margin-top: 18px;
    opacity: .5;
}

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

.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--input-bg);
    border: 1px solid var(--line-strong);
    color: var(--muted);
    cursor: pointer;
    box-shadow: none;
    transition: background .2s, color .2s, border-color .2s;
}

.auth-theme-toggle:hover {
    color: var(--ink);
    border-color: var(--primary);
    transform: none;
    box-shadow: none;
}

.auth-theme-toggle svg { width: 19px; height: 19px; }
