/*
 * Sign-in screen. Same family as the deploy console's: one centred card, brand mark and tagline on
 * top, quiet fields, a single primary action, and a shake when the credentials are refused. Colours
 * come from the console's own tokens, so light, dark and "System" all follow the theme switch.
 */

.login-view {
    background:
        radial-gradient(720px 440px at 50% -10%, var(--accent-soft-2), transparent 64%),
        radial-gradient(560px 380px at 90% 110%, var(--accent-soft), transparent 62%),
        var(--bg);
}

.login-card {
    width: min(400px, 100%);
    padding: 32px 32px 22px;
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-2);
}

/* The old card painted its own mark via ::before; the brand row below replaces it. */
.login-card::before {
    content: none;
}

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

.login-mark {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    box-shadow: var(--accent-shadow);
}

.login-title {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -.02em;
    color: var(--text);
}

.login-tagline {
    font-size: 12px;
    color: var(--muted);
    margin-top: 1px;
}

.login-card .login-sub {
    text-align: left;
    margin: 6px 0 22px;
    font-size: 13px;
}

.login-card input {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: var(--r-md);
}

.login-card input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring);
}

.login-code {
    font-family: var(--mono);
    font-size: 18px;
    letter-spacing: .38em;
    text-align: center;
}

.login-code::placeholder {
    letter-spacing: .38em;
    opacity: .35;
}

.login-pw {
    position: relative;
    display: flex;
}

.login-pw input {
    flex: 1;
    padding-right: 62px;
}

.login-card .login-reveal {
    position: absolute;
    right: 6px;
    top: 4px;
    height: 30px;
    padding: 0 10px;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--r-sm);
    cursor: pointer;
}

.login-card .login-reveal:hover {
    color: var(--text);
    background: var(--surface-3);
}

.login-caps {
    margin: -8px 0 12px;
    font-size: 12px;
    color: var(--warn);
}

.login-card .error {
    margin: 0 0 12px;
    padding: 9px 12px;
    border-radius: var(--r-md);
    background: var(--danger-bg);
    border: 1px solid var(--danger-soft);
    color: var(--danger);
    font-size: 13px;
    line-height: 1.4;
}

.login-card button[type="submit"] {
    margin-top: 2px;
    padding: 11px;
    border-radius: var(--r-md);
    font-size: 14px;
}

.login-card button[type="submit"]:disabled {
    opacity: .7;
    cursor: progress;
}

.login-foot {
    margin: 16px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}

.login-card.shake {
    animation: login-shake .4s var(--ease);
}

@keyframes login-shake {
    20% { transform: translateX(-7px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(2px); }
}

@media (prefers-reduced-motion: reduce) {
    .login-card.shake {
        animation: none;
    }
}

/* Second step: who is signing in, then only the code. */
.login-who {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface-2);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    word-break: break-all;
}

.login-card .login-back {
    flex: none;
    margin: 0;
    padding: 2px 4px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.login-card .login-back:hover {
    text-decoration: underline;
}

.login-hint {
    margin: -6px 0 14px;
    font-size: 12px;
    color: var(--muted);
}

/* Steps are wrappers now, so they carry the card's column layout themselves. */
#login-step-credentials,
#login-step-code {
    display: flex;
    flex-direction: column;
}

#login-step-credentials[hidden],
#login-step-code[hidden] {
    display: none;
}

/* Top-bar mark is the same logo file; the old rule painted a lettered tile. */
img.brand-mark {
    background: none;
    box-shadow: none;
    border-radius: 0;
}
