/* MBDM Auth UI — floating button + modal */

.mbdm-auth-btn {
    position: fixed;
    top: 0.9rem;
    right: 1.2rem;
    z-index: 250;
    background: var(--grad-gold);
    color: #1a0f00;
    border: none;
    padding: 0.55rem 1.2rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 183, 3, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
}
.mbdm-auth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255, 183, 3, 0.4); }
.mbdm-auth-btn.mbdm-auth-signedin {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border-2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.mbdm-auth-btn.mbdm-auth-signedin:hover { background: var(--surface-2); }
.mbdm-auth-btn .mbdm-auth-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--grad-gold);
    flex-shrink: 0;
}
.mbdm-auth-btn .mbdm-auth-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.mbdm-auth-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 1rem;
    animation: fadeIn 0.2s;
}
.mbdm-auth-modal[hidden] { display: none; }

.mbdm-auth-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-xl);
    padding: 2.2rem 2.2rem 1.8rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideIn 0.25s;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } }

.mbdm-auth-close {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 1.4rem;
    display: grid;
    place-items: center;
    cursor: pointer;
    border: none;
}
.mbdm-auth-close:hover { background: var(--surface-3); color: var(--text); }

.mbdm-auth-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.4rem;
    color: var(--text);
}
.mbdm-auth-card p {
    color: var(--text-3);
    font-size: 0.9rem;
    margin-bottom: 1.4rem;
}
.mbdm-auth-card form { display: flex; flex-direction: column; gap: 0.7rem; }
.mbdm-auth-card label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text-2);
    font-weight: 600;
}
.mbdm-auth-card label[hidden] { display: none; }
.mbdm-auth-card input {
    padding: 0.7rem 0.9rem;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s;
    font-family: inherit;
}
.mbdm-auth-card input:focus { border-color: var(--gold); }
.mbdm-auth-msg {
    font-size: 0.85rem;
    color: var(--red);
    min-height: 1.2em;
    text-align: center;
}
.mbdm-auth-msg:empty { display: none; }
.mbdm-auth-submit {
    background: var(--grad-gold);
    color: #1a0f00;
    border: none;
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.4rem;
    transition: all 0.2s;
}
.mbdm-auth-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(255, 183, 3, 0.3); }
.mbdm-auth-submit:disabled { opacity: 0.6; cursor: wait; }
.mbdm-auth-switch {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-3);
}
.mbdm-auth-switch a {
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
}
.mbdm-auth-switch a:hover { text-decoration: underline; }

.mbdm-user-menu {
    position: fixed;
    z-index: 260;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 0.4rem;
    animation: fadeIn 0.15s;
}
.mbdm-user-menu-head {
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-bottom: 0.3rem;
}
.mbdm-user-menu-head strong { color: var(--text); font-size: 0.92rem; }
.mbdm-user-menu-head span { color: var(--text-3); font-size: 0.78rem; }
.mbdm-user-menu a {
    display: block;
    padding: 0.5rem 0.8rem;
    color: var(--text-2);
    font-size: 0.9rem;
    border-radius: 6px;
    text-decoration: none;
}
.mbdm-user-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mbdm-user-menu button {
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.8rem;
    background: none;
    border: none;
    color: var(--red);
    font-size: 0.9rem;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 0.3rem;
    border-top: 1px solid var(--border);
    padding-top: 0.7rem;
}
.mbdm-user-menu button:hover { background: rgba(214, 40, 40, 0.1); }

@media (max-width: 600px) {
    .mbdm-auth-btn { top: 0.6rem; right: 0.7rem; padding: 0.5rem 0.9rem; font-size: 0.82rem; }
    .mbdm-auth-card { padding: 1.6rem 1.4rem; }
}
