/* ═══════════════════════════════════════════════════════
   TBM Auth — widget + modal styles
   ═══════════════════════════════════════════════════════ */

/* ── Auth widget (login button / greeting) ──────────────── */
.tbm-auth-widget {
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: flex-end;
    padding: 0 0 10px;
    direction: rtl;
}
.tbm-user-greeting {
    font-size: 13px;
    color: #374151;
    font-weight: 500;
}
.tbm-auth-link {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline;
}
.tbm-auth-link:hover { color: #374151; }
.tbm-auth-link-cta {
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
}
.tbm-auth-link-cta:hover { color: #1d4ed8; }

/* ── Modal overlay ──────────────────────────────────────── */
#tbm-auth-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
}
.tbm-auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .48);
    backdrop-filter: blur(2px);
}

/* ── Modal box ──────────────────────────────────────────── */
.tbm-auth-box {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: calc(100% - 32px);
    max-width: 400px;
    padding: 30px 28px 24px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .22);
    direction: rtl;
    animation: tbmSlideUp .22s ease;
}
@keyframes tbmSlideUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Close button ───────────────────────────────────────── */
.tbm-auth-close {
    position: absolute;
    top: 14px;
    left: 16px;
    background: none;
    border: none;
    font-size: 18px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: 6px;
    transition: color .15s, background .15s;
}
.tbm-auth-close:hover { color: #374151; background: #f3f4f6; }

/* ── Tabs row ───────────────────────────────────────────── */
.tbm-auth-tabs-row {
    display: flex;
    gap: 4px;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 22px;
}
.tbm-auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}
.tbm-auth-tab.active {
    background: #fff;
    color: #111827;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .1);
}

/* ── Social row ─────────────────────────────────────────── */
.tbm-social-row { margin-bottom: 4px; }

.tbm-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: 1.5px solid #dadce0;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-weight: 500;
    color: #3c4043;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, box-shadow .15s;
    box-sizing: border-box;
}
.tbm-btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.tbm-btn-disabled { opacity: .45; cursor: not-allowed !important; }
.tbm-hint {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin: 6px 0 0;
}
.tbm-hint a { color: #2563eb; text-decoration: none; }
.tbm-hint a:hover { text-decoration: underline; }

/* ── Divider ─────────────────────────────────────────────── */
.tbm-auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    color: #9ca3af;
    font-size: 12px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.tbm-auth-divider::before,
.tbm-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* ── Inputs ──────────────────────────────────────────────── */
.tbm-auth-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    margin-bottom: 10px;
    outline: none;
    transition: border-color .15s;
    background: #fff;
}
.tbm-auth-input:focus { border-color: #2563eb; }
.tbm-auth-input::placeholder { color: #9ca3af; }

/* ── Role cards ──────────────────────────────────────────── */
.tbm-roles {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.tbm-role-card {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.tbm-role-card:has(input:checked) { border-color: #2563eb; background: #eff6ff; }
.tbm-role-card input[type="radio"] { margin-top: 2px; flex-shrink: 0; accent-color: #2563eb; }
.tbm-role-card > span { display: flex; flex-direction: column; gap: 2px; }
.tbm-role-card strong { font-size: 14px; color: #111827; font-weight: 600; }
.tbm-role-card small  { font-size: 12px; color: #6b7280; }

/* ── Error ───────────────────────────────────────────────── */
.tbm-auth-error {
    color: #dc2626;
    font-size: 13px;
    min-height: 18px;
    margin-bottom: 6px;
    text-align: center;
}

/* ── Submit button ───────────────────────────────────────── */
.tbm-auth-submit {
    display: block;
    width: 100%;
    padding: 11px;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    margin-bottom: 14px;
}
.tbm-auth-submit:hover    { background: #1d4ed8; }
.tbm-auth-submit:disabled { background: #93c5fd; cursor: not-allowed; }

/* ── Footer link ─────────────────────────────────────────── */
.tbm-auth-foot {
    text-align: center;
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}
.tbm-auth-foot a { color: #2563eb; text-decoration: none; }
.tbm-auth-foot a:hover { text-decoration: underline; }

/* ── Nickname field wrapper ─────────────────────────────── */
.tbm-nick-wrap { position: relative; margin-bottom: 0; }
.tbm-nick-wrap .tbm-auth-input { margin-bottom: 2px; }

.tbm-nickname-status {
    display: block;
    font-size: 12px;
    padding: 0 4px;
    min-height: 16px;
    margin-bottom: 8px;
}
.tbm-nick-ok  { color: #059669; }
.tbm-nick-err { color: #dc2626; }

/* ── Profile link in auth widget ────────────────────────── */
.tbm-profile-link {
    font-size: 12px;
    color: #6b7280;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}
.tbm-profile-link:hover { color: #2563eb; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .tbm-auth-box { padding: 24px 16px 18px; }
    .tbm-roles { flex-direction: column; }
}

/* ── Profile side-panel ─────────────────────────────────── */
#tbm-profile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99998;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
#tbm-profile-overlay.tbm-pp-open {
    opacity: 1;
    pointer-events: auto;
}
#tbm-profile-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 460px;
    max-width: 100vw;
    background: #f8fafc;
    z-index: 99999;
    box-shadow: -4px 0 32px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
#tbm-profile-overlay.tbm-pp-open #tbm-profile-panel {
    transform: translateX(0);
}
body.tbm-pp-lock { overflow: hidden; }

/* Panel header */
.tbm-pp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
    color: #fff;
    flex-shrink: 0;
}
.tbm-pp-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .02em;
}
.tbm-pp-close {
    background: rgba(255,255,255,.18);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    line-height: 1;
}
.tbm-pp-close:hover { background: rgba(255,255,255,.32); }

/* Panel body */
.tbm-pp-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
/* Tighten account styles inside the panel */
.tbm-pp-body .tbm-acc-wrap {
    max-width: 100%;
    padding: 0;
}
.tbm-pp-body .tbm-acc-card { border-radius: 12px; padding: 16px 18px; }
.tbm-pp-body .tbm-acc-avatar { width: 56px; height: 56px; }
.tbm-pp-body .tbm-acc-avatar-initials { font-size: 20px; }
.tbm-pp-body .tbm-acc-card-name { font-size: 17px; }
.tbm-pp-body .tbm-acc-section { border-radius: 12px; padding: 18px 20px; }
.tbm-pp-body .tbm-acc-two-col { grid-template-columns: 1fr; gap: 0; }

@media (max-width: 500px) {
    #tbm-profile-panel { width: 100vw; }
}
