.auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: none !important;
    flex-direction: column !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.95);
}

.auth-overlay.visible {
    display: flex;
}

.auth-overlay--done {
    opacity: 0;
    transition: opacity 0.4s;
}

.auth-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px;
}

.auth-card {
    background: var(--bg);
    color: var(--fg);
    border: 2px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 32px;
    width: 360px;
    max-width: 90vw;
}

.auth-logo {
    text-align: center;
    margin-bottom: 16px;
}

.auth-logo img {
    width: 56px;
    height: 56px;
}

.auth-title {
    text-align: center;
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 800;
    color: var(--fg);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    width: 100%;
    height: var(--btn-size);
    padding: 0 12px;
    background: var(--bg);
    color: var(--fg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.auth-input:user-invalid,
.auth-input:invalid {
    border-color: var(--danger);
}

.auth-submit {
    width: 100%;
    height: var(--btn-size);
    background: var(--accent);
    color: var(--accent-contrast, #ffffff);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 50ms, opacity 50ms;
}

.auth-submit:active {
    background: var(--accent-active);
}

.auth-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-submit:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.auth-error {
    color: var(--danger);
    font-size: 13px;
    text-align: center;
    margin: 0;
    min-height: 18px;
}

.auth-2fa {
    display: none;
}

.auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg);
    font-size: 14px;
    padding: 32px;
    opacity: 0.6;
}

/* ── Night mode ── */

[data-theme="night"] .auth-card {
    background: var(--bg);
    border-color: var(--border);
}

[data-theme="night"] .auth-title {
    color: var(--fg);
}

[data-theme="night"] .auth-input {
    background: var(--bg);
    color: var(--fg);
    border-color: var(--border);
}

[data-theme="night"] .auth-error {
    color: var(--danger);
}

/* ── Glove mode ── */

[data-gloves="on"] .auth-card {
    padding: 40px;
    width: 420px;
}

[data-gloves="on"] .auth-title {
    font-size: 24px;
    margin-bottom: 28px;
}

[data-gloves="on"] .auth-form {
    gap: 16px;
}

[data-gloves="on"] .auth-input {
    font-size: 16px;
    padding: 0 16px;
}

[data-gloves="on"] .auth-submit {
    font-size: 16px;
}
