/* ── Auth header widget ─────────────────────────────────────────────────── */

#authWidget {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.auth-signin-btn {
    background: transparent;
    border: 1px solid #4a8fa8;
    color: #7ec8e3;
    font-size: 13px;
    font-family: inherit;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.auth-signin-btn:hover {
    background: #4a8fa8;
    color: #fff;
}

.auth-user {
    display: flex;
    align-items: center;
    position: relative;
}

.auth-avatar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #4a8fa8;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    padding: 0;
}

.auth-avatar-btn:hover {
    background: #3a7a93;
    box-shadow: 0 0 0 2px rgba(74, 143, 168, 0.4);
}

.auth-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    background: #19243a;
    border: 1px solid #2a3a55;
    border-radius: 7px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
    z-index: 9999;
    overflow: hidden;
}

.auth-dropdown-name {
    padding: 10px 14px 8px;
    font-size: 12px;
    color: #8a9bb5;
    border-bottom: 1px solid #2a3a55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.auth-signout-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    color: #c8d4e4;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    padding: 9px 14px;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.auth-signout-btn:hover {
    background: rgba(74, 143, 168, 0.15);
    color: #fff;
}

/* ── Modal overlay ──────────────────────────────────────────────────────── */

.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal-hidden {
    display: none !important;
}

/* ── Modal card ─────────────────────────────────────────────────────────── */

.auth-modal-card {
    background: #19243a;
    border: 1px solid #2a3a55;
    border-radius: 10px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 380px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: transparent;
    border: none;
    color: #8a9bb5;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    transition: color 0.15s;
}

.auth-modal-close:hover {
    color: #c8d4e4;
}

.auth-modal-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 600;
    color: #e0e8f4;
    letter-spacing: 0.01em;
}

/* ── Google button ──────────────────────────────────────────────────────── */

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 9px 16px;
    background: #fff;
    color: #333;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
}

.auth-google-btn:hover {
    background: #f0f0f0;
}

.auth-google-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Divider ────────────────────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
    color: #4a5a72;
    font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #2a3a55;
}

/* ── Fields ─────────────────────────────────────────────────────────────── */

.auth-field {
    margin-bottom: 14px;
}

.auth-field--hidden {
    display: none !important;
}

.auth-label {
    display: block;
    font-size: 12px;
    color: #8a9bb5;
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.auth-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    background: #111b2e;
    border: 1px solid #2a3a55;
    border-radius: 5px;
    color: #c8d4e4;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}

.auth-input:focus {
    border-color: #4a8fa8;
}

/* ── Error ──────────────────────────────────────────────────────────────── */

.auth-error {
    background: rgba(200, 60, 60, 0.15);
    border: 1px solid rgba(200, 60, 60, 0.35);
    color: #f08080;
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 5px;
    margin-bottom: 12px;
}

/* ── Submit button ──────────────────────────────────────────────────────── */

.auth-submit-btn {
    width: 100%;
    padding: 9px;
    background: #4a8fa8;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 4px;
}

.auth-submit-btn:hover {
    background: #3a7a93;
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ── Toggle sign-up / sign-in ───────────────────────────────────────────── */

.auth-toggle-row {
    margin-top: 10px;
}

.auth-toggle-btn--outline {
    display: block;
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #2a3a55;
    color: #8a9bb5;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 6px;
    transition: border-color 0.15s, color 0.15s;
    text-align: center;
}

.auth-toggle-btn--outline:hover {
    border-color: #4a8fa8;
    color: #c8d4e4;
}

/* ── Account: role, menu links, invite code, privacy note ─────────────────── */

.auth-dropdown-role {
    margin: 8px 14px 6px;
    padding: 2px 8px;
    width: fit-content;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(138, 155, 181, 0.18);
    color: #c8d4e4;
}
.auth-dropdown-limits {
    margin: -2px 14px 8px;
    max-width: 200px;
    font-size: 11px;
    line-height: 1.4;
    color: #8a9bb5;
}
.auth-dropdown-limits[hidden] { display: none; }
.auth-dropdown-role--standard { background: rgba(74, 143, 168, 0.25); color: #9fd6e6; }
.auth-dropdown-role--pro { background: rgba(176, 132, 255, 0.22); color: #d2bdff; }
.auth-dropdown-role--admin { background: rgba(232, 163, 61, 0.22); color: #f2c27a; }

a.auth-menu-link {
    box-sizing: border-box;
    text-decoration: none;
}
.auth-menu-link[hidden] { display: none; }

.auth-privacy-note {
    margin: 14px 0 0;
    font-size: 12px;
    line-height: 1.45;
    color: #8a9bb5;
    text-align: center;
}
.auth-privacy-note a { color: #9fd6e6; }

.auth-redeem-card { max-width: 380px; }
.auth-redeem-hint {
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.45;
    color: #8a9bb5;
}
.auth-redeem-input {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 18px;
    letter-spacing: 0.12em;
    text-align: center;
    text-transform: uppercase;
}
.auth-redeem-result {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
}
.auth-redeem-result--ok { background: rgba(80, 180, 120, 0.16); color: #9be0b4; }
.auth-redeem-result--info { background: rgba(74, 143, 168, 0.16); color: #9fd6e6; }
.auth-redeem-result--error { background: rgba(220, 90, 90, 0.16); color: #f0a0a0; }
.auth-redeem-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
}
.auth-redeem-actions .auth-submit-btn,
.auth-redeem-actions .auth-toggle-btn { width: auto; margin: 0; padding-inline: 16px; }

/* The side-panel tabs (z-index 950) sit above the navbar (100); while the
   account menu is open, lift the navbar so the menu is not cut by them. */
.chameleon-navbar:has(.auth-dropdown:not([hidden])) {
    z-index: 1000;
}
