.mtp-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    font-size: 12px;
}

.mtp-auth-box {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 46px 26px 24px;
    width: 100%;
    max-width: 380px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.mtp-auth-close {
    position: absolute;
    top: 12px;
    right: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    z-index: 2;
}

.mtp-auth-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.mtp-auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.mtp-auth-tab {
    flex: 1;
    padding: 9px 0;
    border: 1px solid #d1d5db;
    background: #f8fafc;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    color: #475569;
}

.mtp-auth-tab-active {
    background: #1e3a5f;
    color: #fff;
    border-color: #1e3a5f;
}

.mtp-auth-panel {
    display: none;
}

.mtp-auth-panel-active {
    display: block;
}

.mtp-auth-panel label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: #1e293b;
    margin: 12px 0 5px;
}

.mtp-auth-panel input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

.mtp-password-wrap {
    position: relative;
}

.mtp-password-wrap input {
    padding-right: 38px;
}

.mtp-password-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    padding: 4px 6px;
    line-height: 1;
    color: #64748b;
}

.mtp-password-eye:hover {
    color: #1e3a5f;
}

.mtp-auth-submit {
    width: 100%;
    margin-top: 18px;
    padding: 11px;
    border: none;
    border-radius: 7px;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
}

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

.mtp-auth-error {
    color: #dc2626;
    font-size: 12px;
    min-height: 14px;
    margin: 0 0 4px;
}

.mtp-auth-hint {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 4px;
}

.mtp-auth-switch {
    text-align: center;
    font-size: 12px;
    margin-top: 14px;
    color: #64748b;
}

.mtp-auth-switch a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

.mtp-auth-success-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 10px;
}

.mtp-auth-generated-password {
    background: #f1f5f9;
    border: 1.5px dashed #94a3b8;
    border-radius: 8px;
    padding: 12px;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 1px;
    color: #1e3a5f;
    margin: 14px 0;
    word-break: break-all;
}

.mtp-header-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, #1e3a5f, #2563eb);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 9px 18px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(30, 58, 95, 0.25);
    transition: filter 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.mtp-header-login-btn::before {
    content: '👤';
    font-size: 12px;
}

.mtp-header-login-btn:hover {
    filter: brightness(1.1);
}

.mtp-header-login-btn:active {
    transform: scale(0.97);
}

.mtp-header-account {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 5px 12px 5px 5px;
}

.mtp-header-account-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #16a34a);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

.mtp-header-account-name {
    font-weight: 700;
    color: #1e293b;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mtp-header-logout-link {
    color: #dc2626;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    padding-left: 6px;
    border-left: 1px solid #e2e8f0;
    white-space: nowrap;
}

.mtp-header-logout-link:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .mtp-header-login-btn {
        padding: 7px 12px;
        font-size: 11px;
    }
    .mtp-header-account {
        padding: 4px 10px 4px 4px;
    }
    .mtp-header-account-name {
        max-width: 80px;
        font-size: 11px;
    }
    .mtp-header-account-avatar {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    .mtp-header-logout-link {
        font-size: 11px;
    }
}

.mtp-auth-transition {
    text-align: center;
    padding: 30px 10px;
}

.mtp-auth-transition p {
    font-size: 12px;
    color: #475569;
    margin-top: 14px;
}

.mtp-auth-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    margin: 0 auto;
    animation: mtp-auth-spin 0.7s linear infinite;
}

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