/* ===== Auth & Membership UI ===== */

/* --- Account tab: needs-login indicator --- */
.settings-tab.needs-login {
  color: var(--settings-accent, #5eead4);
  position: relative;
}
.settings-tab.needs-login::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: var(--settings-accent, #5eead4);
  border-radius: 50%;
  animation: auth-pulse 2s ease-in-out infinite;
}
@keyframes auth-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

/* --- User menu button in hero toolbar --- */
.user-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
}
.user-menu-btn span {
  font-size: 12px;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-btn.is-logged-in i[data-lucide] {
  color: var(--settings-accent, #5eead4);
}

/* --- Locked nav buttons --- */
.workspace-nav-btn.is-locked {
  opacity: 0.55;
  position: relative;
}
.workspace-nav-btn.is-locked::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--settings-warning, #fbbf24);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--settings-surface, #111619);
}

/* --- 4K option disabled --- */
#resolution option[value="4K"]:disabled {
  color: var(--settings-subtle, #73818a);
}

/* --- Auth modal overlay --- */
.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(4, 7, 9, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}
.auth-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.auth-modal-overlay[hidden] {
  display: none !important;
}

/* --- Auth modal card --- */
.auth-modal {
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 28px 24px;
  background: var(--settings-surface, #111619);
  border: 1px solid var(--settings-border-strong, rgba(226, 232, 240, 0.22));
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  color: var(--settings-text, #edf3f5);
  position: relative;
  transform: translateY(12px);
  transition: transform 150ms ease;
}
.auth-modal-overlay.active .auth-modal {
  transform: translateY(0);
}

.auth-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--settings-muted, #9aa7ad);
  cursor: pointer;
  border-radius: 6px;
  transition: background 120ms ease, color 120ms ease;
}
.auth-modal-close:hover {
  background: var(--settings-surface-soft, #1c2429);
  color: var(--settings-text, #edf3f5);
}

.auth-modal-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
}
.auth-modal-subtitle {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--settings-muted, #9aa7ad);
}

/* --- Auth form --- */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.auth-form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--settings-muted, #9aa7ad);
}
.auth-form-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: var(--settings-control, #0b1013);
  border: 1px solid var(--settings-border, rgba(226, 232, 240, 0.13));
  border-radius: 6px;
  color: var(--settings-text, #edf3f5);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 120ms ease;
}
.auth-form-field input:focus {
  border-color: var(--settings-accent, #5eead4);
}
.auth-form-field input::placeholder {
  color: var(--settings-subtle, #73818a);
}
.auth-form-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--settings-subtle, #73818a);
}

.auth-password-wrap {
  position: relative;
}
.auth-password-wrap input {
  padding-right: 40px;
}
.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--settings-subtle, #73818a);
  cursor: pointer;
  border-radius: 4px;
}
.auth-password-toggle:hover {
  color: var(--settings-text, #edf3f5);
}

.auth-error {
  padding: 10px 12px;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 6px;
  font-size: 13px;
  color: var(--settings-danger, #f87171);
}
.auth-error[hidden] {
  display: none !important;
}

.auth-submit-btn {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 6px;
  background: var(--settings-accent, #5eead4);
  color: #041017;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 120ms ease;
}
.auth-submit-btn:hover {
  opacity: 0.88;
}
.auth-submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.auth-switch-btn {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--settings-accent, #5eead4);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}
.auth-switch-btn:hover {
  text-decoration: underline;
}

/* --- Membership prompt modal --- */
.membership-prompt-modal {
  text-align: center;
}
.membership-prompt-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.membership-prompt-content > i[data-lucide="crown"] {
  width: 48px;
  height: 48px;
  color: var(--settings-warning, #fbbf24);
}
.membership-prompt-content h2 {
  margin: 0;
  font-size: 20px;
}
.membership-prompt-content > p {
  margin: 0;
  font-size: 14px;
  color: var(--settings-muted, #9aa7ad);
}
.membership-benefits {
  width: 100%;
}
.membership-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.membership-benefits li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--settings-surface-soft, #1c2429);
  border-radius: 6px;
  font-size: 14px;
}
.membership-benefits li::before {
  content: "\2713";
  color: var(--settings-accent, #5eead4);
  font-weight: 700;
}

/* --- Account panel in settings --- */
.account-section {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.account-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--settings-surface-soft, #1c2429);
  border-radius: 8px;
}
.account-user-card .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--settings-accent-soft, rgba(94, 234, 212, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--settings-accent, #5eead4);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}
.account-user-info {
  flex: 1;
  min-width: 0;
}
.account-user-info .username {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-user-info .role {
  font-size: 12px;
  color: var(--settings-muted, #9aa7ad);
}

.account-membership-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.account-membership-badge.is-member {
  background: rgba(251, 191, 36, 0.12);
  color: var(--settings-warning, #fbbf24);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.account-membership-badge.is-free {
  background: var(--settings-surface-soft, #1c2429);
  color: var(--settings-muted, #9aa7ad);
}

.account-invite-box {
  padding: 12px 14px;
  background: var(--settings-surface-soft, #1c2429);
  border: 1px solid var(--settings-border, rgba(226, 232, 240, 0.13));
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.account-invite-code {
  font-family: "Cascadia Code", "Consolas", monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--settings-accent, #5eead4);
}
.account-invite-copy-btn {
  padding: 4px 12px;
  background: var(--settings-accent-soft, rgba(94, 234, 212, 0.12));
  border: 1px solid rgba(94, 234, 212, 0.3);
  border-radius: 6px;
  color: var(--settings-accent, #5eead4);
  font-size: 12px;
  cursor: pointer;
}
.account-invite-copy-btn:hover {
  background: var(--settings-accent, #5eead4);
  color: #0b1013;
}
.account-invite-meta {
  width: 100%;
  font-size: 12px;
  color: var(--settings-muted, #9aa7ad);
}

.account-redeem-form {
  display: flex;
  gap: 8px;
}
.account-redeem-form input {
  flex: 1;
  height: 38px;
  padding: 0 10px;
  background: var(--settings-control, #0b1013);
  border: 1px solid var(--settings-border, rgba(226, 232, 240, 0.13));
  border-radius: 6px;
  color: var(--settings-text, #edf3f5);
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.account-redeem-form input:focus {
  border-color: var(--settings-accent, #5eead4);
}
.account-redeem-form button {
  height: 38px;
  padding: 0 16px;
  border: none;
  border-radius: 6px;
  background: var(--settings-accent, #5eead4);
  color: #041017;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 120ms ease;
}
.account-redeem-form button:hover {
  opacity: 0.88;
}
.account-redeem-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.account-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--settings-muted, #9aa7ad);
  margin: 0 0 4px;
}

.account-logout-btn {
  width: 100%;
  height: 38px;
  border: 1px solid var(--settings-border-strong, rgba(226, 232, 240, 0.22));
  border-radius: 6px;
  background: transparent;
  color: var(--settings-muted, #9aa7ad);
  font-size: 13px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}
.account-logout-btn:hover {
  border-color: var(--settings-danger, #f87171);
  color: var(--settings-danger, #f87171);
}

.account-admin-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 38px;
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 6px;
  background: rgba(94, 234, 212, 0.1);
  color: var(--settings-accent, #5eead4);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.account-admin-link:hover {
  background: rgba(94, 234, 212, 0.18);
  border-color: var(--settings-accent, #5eead4);
}

.account-login-hint {
  text-align: center;
  padding: 24px 12px;
}
.account-login-hint p {
  margin: 0 0 16px;
  color: var(--settings-muted, #9aa7ad);
  font-size: 14px;
}
.account-login-hint .auth-submit-btn {
  margin-bottom: 8px;
}

/* ===== Quota Display ===== */
.quota-info-container {
  margin: 12px 0;
}
.quota-card {
  background: var(--settings-surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--settings-border, rgba(255,255,255,0.08));
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quota-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.quota-row .quota-label {
  color: var(--settings-muted, #9aa7ad);
}
.quota-row .quota-value {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 0;
}
.quota-multiplier {
  font-size: 11px;
  opacity: 0.7;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.quota-unlimited-badge {
  display: inline-block;
  background: var(--settings-accent, #5eead4);
  color: var(--settings-bg, #1a1a2e);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 600;
}
.quota-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}
.quota-bar-fill {
  height: 100%;
  background: var(--settings-accent, #5eead4);
  border-radius: 2px;
  transition: width 300ms ease;
}
.quota-bar-fill.quota-bar-bonus {
  background: var(--settings-primary, #818cf8);
}

/* --- Account email binding --- */
.account-email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}
.account-email-row .account-section-title {
  min-width: 64px;
}
.account-email-value {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--settings-text, #e2e8f0);
  font-size: 13px;
  line-height: 1.4;
}
.account-email-value.is-empty {
  color: var(--settings-muted, #9aa7ad);
}
.account-email-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(94, 234, 212, 0.12);
  color: var(--settings-accent, #5eead4);
  border: 1px solid rgba(94, 234, 212, 0.3);
  white-space: nowrap;
}
.account-email-bind-btn {
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid rgba(94, 234, 212, 0.35);
  background: rgba(94, 234, 212, 0.1);
  color: var(--settings-accent, #5eead4);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.account-email-bind-btn:hover {
  background: rgba(94, 234, 212, 0.18);
  border-color: rgba(94, 234, 212, 0.55);
}
.bind-email-dialog {
  max-width: 380px;
}
.dialog-error {
  color: var(--settings-danger, #f87171);
  font-size: 13px;
  line-height: 1.4;
  margin: -8px 0 12px;
}
