.auth-main {
    min-height: 620px;
    text-align: left;
}

.auth-shell {
    position: relative;
    width: min(480px, 100%);
    padding: 34px 30px;
    border-radius: 20px;
    background: var(--surface);
}

.tab-row {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

.tab-btn {
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0 0 4px;
    cursor: pointer;
    transition:
        color 0.2s,
        border-color 0.2s;
}

.tab-btn:hover {
    color: var(--text);
}

.tab-btn.active {
    color: var(--text);
    border-color: #0088ff;
}

.tab-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-section h2 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 1.52rem;
    font-weight: 600;
    line-height: 1.24;
    letter-spacing: -0.015em;
}

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

.auth-shell label {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.86rem;
    letter-spacing: 0.01em;
}

.auth-shell input[type="text"],
.auth-shell input[type="password"] {
    width: 100%;
    border: 1px solid #2f2f2f;
    border-radius: 12px;
    padding: 12px 13px;
    background: #101010;
    color: var(--text);
    font-size: 0.95rem;
    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.auth-shell input[type="text"]::placeholder,
.auth-shell input[type="password"]::placeholder {
    color: #666666;
}

.auth-shell input[type="text"]:focus,
.auth-shell input[type="password"]:focus {
    outline: none;
    border-color: #0088ff;
    box-shadow: 0 0 0 3px #0088ff2b;
}

#totpCode {
    letter-spacing: 1px;
    text-align: center;
}

.primary-btn {
    margin-top: 14px;
    border: 1px solid var(--primary);
    border-radius: 12px;
    background: var(--primary);
    color: #000000;
    padding: 11px 16px;
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition:
        background-color 0.2s,
        border-color 0.2s,
        color 0.2s;
}

.primary-btn:hover:not(:disabled) {
    opacity: 0.9;
}

.primary-btn:disabled {
    opacity: 0.52;
    cursor: not-allowed;
}

.terms-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.terms-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #0088ff;
}

.terms-container label {
    margin: 0;
    line-height: 1.45;
    font-size: 0.84rem;
}

.terms-container a {
    color: #9dc9ff;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terms-container a:hover {
    color: #c2deff;
}

.twofactor-desc {
    margin: 0 0 10px;
    color: #9da7b3;
    font-size: 0.9rem;
    line-height: 1.45;
}

#resultArea {
    margin-top: 16px;
    min-height: 0;
    font-size: 0.9rem;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(4px);
    transition:
        opacity 0.2s,
        transform 0.2s;
}

#resultArea.is-visible {
    opacity: 1;
    transform: translateY(0);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
}

#resultArea.is-error {
    color: #ffc4ce;
    border-color: #6b2b36;
    background: #271418;
}

#resultArea.is-success {
    color: #b8efcf;
    border-color: #2a5b3f;
    background: #13261b;
}

#rateLimitOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.86);
    color: #ffc98a;
}

#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.35s ease-out;
}

#loadingOverlay.hide {
    opacity: 0;
    pointer-events: none;
}

.loading-text {
    margin-bottom: 12px;
    color: #e5eaf0;
    font-size: 0.95rem;
}

#loadingOverlay.is-success .loading-text {
    margin-bottom: 0;
    max-width: 340px;
    text-align: center;
    line-height: 1.55;
    color: #b8efcf;
    font-size: 1.02rem;
    font-weight: 600;
}

.progress-container {
    width: 220px;
    height: 3px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.14);
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: #0088ff;
    transition: width 0.3s ease;
}

@media (max-width: 768px) {
    .auth-main {
        min-height: auto;
        padding: 42px 8px;
    }

    .auth-shell {
        width: 100%;
        padding: 24px 18px;
        border-radius: 14px;
    }

    .auth-section h2 {
        font-size: 1.34rem;
    }

    .tab-row {
        gap: 18px;
        margin-bottom: 22px;
    }

    .tab-btn {
        font-size: 0.89rem;
    }

    .primary-btn {
        width: 100%;
    }
}
