:root {
    --tb-auth-gradient: linear-gradient(135deg, #7e6ffe 0%, #c3a2ff 50%, #3d4ae3 100%);
    --tb-auth-accent: #6c5dfc;
}

body.tb-auth-lock {
    overflow: hidden;
}

.tb-auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 12, 41, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tb-auth-overlay[hidden] {
    display: none;
}

.tb-auth-overlay.open {
    opacity: 1;
}

.tb-auth-modal {
    position: relative;
    width: min(440px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    border-radius: 22px;
    background: #fff;
    color: #1e1b4b;
    box-shadow: 0 30px 80px rgba(30, 27, 75, 0.35);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    font-family: var(--font-body, "Plus Jakarta Sans", sans-serif);
}

.tb-auth-overlay.open .tb-auth-modal {
    transform: none;
}

.tb-auth-glow {
    position: absolute;
    inset: 0 0 auto 0;
    height: 150px;
    background: var(--tb-auth-gradient);
    opacity: 0.14;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(#000, transparent);
    mask-image: linear-gradient(#000, transparent);
}

.tb-auth-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(30, 27, 75, 0.06);
    color: #4b5563;
    cursor: pointer;
    z-index: 1;
}

.tb-auth-close:hover {
    background: rgba(30, 27, 75, 0.12);
}

.tb-auth-body {
    position: relative;
    padding: 28px 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tb-auth-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-right: 36px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(126, 111, 254, 0.25);
    box-shadow: 0 8px 24px rgba(126, 111, 254, 0.12);
}

.tb-auth-plan-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 18px;
    background: var(--tb-auth-gradient);
    box-shadow: 0 8px 18px rgba(126, 111, 254, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.tb-auth-plan-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.tb-auth-plan-info small,
.tb-auth-plan-info span {
    font-size: 11.5px;
    color: #6b7280;
}

.tb-auth-plan-info strong {
    font-family: var(--font-title, "Outfit", sans-serif);
    font-size: 17px;
}

.tb-auth-plan-price {
    text-align: right;
    line-height: 1.1;
}

.tb-auth-plan-price b {
    display: block;
    font-family: var(--font-title, "Outfit", sans-serif);
    font-size: 17px;
    background: var(--tb-auth-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tb-auth-plan-price small {
    font-size: 11px;
    color: #6b7280;
}

.tb-auth-title {
    margin: 4px 0 0;
    font-family: var(--font-title, "Outfit", sans-serif);
    font-size: 22px;
    font-weight: 800;
    color: #1e1b4b;
}

.tb-auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: 12px;
    background: #f3f2ff;
}

.tb-auth-tabs button {
    padding: 9px;
    border: none;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-weight: 700;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.tb-auth-tabs button.active {
    background: #fff;
    color: var(--tb-auth-accent);
    box-shadow: 0 2px 8px rgba(30, 27, 75, 0.08);
}

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

.tb-auth-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.tb-auth-form input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fafafe;
    font: inherit;
    font-size: 15px;
    color: #111827;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.tb-auth-form input:focus {
    border-color: #7e6ffe;
    box-shadow: 0 0 0 4px rgba(126, 111, 254, 0.18);
    background: #fff;
}

.tb-auth-form input[name="code"] {
    letter-spacing: 0.5em;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
}

.tb-auth-password {
    position: relative;
    display: block;
}

.tb-auth-password input {
    padding-right: 44px;
}

.tb-auth-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
}

.tb-auth-note {
    margin: 0;
    font-size: 13px;
    color: #4b5563;
}

.tb-auth-note i {
    color: var(--tb-auth-accent);
    margin-right: 4px;
}

.tb-auth-error {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.tb-auth-error[hidden] {
    display: none;
}

.tb-auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px;
    margin-top: 4px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    background: var(--tb-auth-gradient);
    background-size: 160% 160%;
    box-shadow: 0 12px 28px rgba(126, 111, 254, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background-position 0.4s ease;
}

.tb-auth-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    background-position: 100% 100%;
    box-shadow: 0 16px 34px rgba(126, 111, 254, 0.5);
}

.tb-auth-submit:disabled {
    cursor: progress;
    opacity: 0.85;
}

.tb-auth-submit.busy i {
    animation: tb-auth-nudge 0.8s ease-in-out infinite;
}

@keyframes tb-auth-nudge {
    50% { transform: translateX(4px); }
}

.tb-auth-link {
    align-self: center;
    border: none;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
}

.tb-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #9ca3af;
}

.tb-auth-divider::before,
.tb-auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.tb-auth-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #111827;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.tb-auth-google:hover {
    background: #fafafe;
    border-color: #c3a2ff;
}

.tb-auth-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    text-align: center;
    padding-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.tb-auth-foot i {
    color: #10b981;
    margin-right: 4px;
}

.tb-auth-foot small {
    font-size: 11px;
    color: #9ca3af;
}

.tb-auth-foot a {
    color: var(--tb-auth-accent);
    text-decoration: none;
}

@media (max-width: 480px) {
    .tb-auth-body {
        padding: 24px 18px 18px;
    }

    .tb-auth-plan-info small {
        display: none;
    }

    .tb-auth-plan-price b {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tb-auth-overlay,
    .tb-auth-modal,
    .tb-auth-submit {
        transition: none;
    }
}
