/* ============= GLOBAL LAYOUT & BASE STYLES ============= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #111827 0%, #020617 45%, #000 100%);
  color: #f9fafb;
  padding: 24px;
  line-height: 1.5;
}

/* Smooth scrolling for quick access links */
html {
  scroll-behavior: smooth;
}

/* Inputs and Textareas */
input,
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  margin: 4px 0 10px 0;
  background-color: #020617;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.9rem;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #4f46e5;
  outline-offset: 1px;
  border-color: #4f46e5;
}

/* Generic Buttons */
button {
  padding: 9px 18px;
  margin: 8px 0;
  background: #111827;
  color: #e5e7eb;
  border: 1px solid #374151;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.1s ease,
    box-shadow 0.1s ease;
}

button:hover {
  background: #1f2937;
  border-color: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
}

button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* Variants */
.btn-primary {
  background: linear-gradient(135deg, #4c1d95, #7e22ce);
  border-color: transparent;
  color: #f9fafb;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
}

.btn-danger {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fee2e2;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #9ca3af;
}

.btn-ghost:hover {
  background: #111827;
  border-color: #1f2937;
  color: #e5e7eb;
}

/* Progress bars */
progress {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background-color: #111827;
  border: none;
}

progress::-webkit-progress-bar {
  background-color: #111827;
}

progress::-webkit-progress-value {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
}

progress::-moz-progress-bar {
  background: linear-gradient(90deg, #4f46e5, #8b5cf6);
}

/* Hide section-specific progress by default; rightbar mirrors it */
#uploadProgress,
#musicUploadProgress,
#showUploadProgress,
#galleryUploadProgress,
#merchUploadProgress {
  display: none;
}

/* ============= LOGIN CARD ============= */

#login {
  max-width: 420px;
  margin: 40px auto;
  background: rgba(15, 23, 42, 0.95);
  padding: 28px 24px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(15,23,42,0.9);
}

#login h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
}

#login button {
  width: 100%;
}

#login .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#login .login-logo img {
  height: 44px;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.7));
}


/* ============= ADMIN WRAPPER ============= */

#panel {
  max-width: 1400px;
  margin: 0 auto;
  display: none; /* shown only after auth */
}

/* Three-column shell: sidebar | main | rightbar */
.admin-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: flex-start;
}

/* ============= LEFT SIDEBAR (NAV) ============= */

.admin-sidebar {
  background: radial-gradient(circle at top left, #1e293b 0%, #020617 60%);
  border-radius: 18px;
  padding: 18px 16px 16px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 480px;
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.admin-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin: 0 0 16px;
}

.admin-title::after {
  content: " ";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Main nav links */
.admin-nav-link {
  width: 100%;
  background: transparent;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: #9ca3af;
  justify-content: flex-start;
}

.admin-nav-link::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #374151;
  margin-right: 6px;
}

.admin-nav-link:hover {
  background: rgba(15, 23, 42, 0.85);
  border-color: #1f2937;
  color: #e5e7eb;
}

.admin-nav-link.active {
  background: linear-gradient(135deg, rgba(76,29,149,0.9), rgba(147,51,234,0.9));
  border-color: transparent;
  color: #f9fafb;
  box-shadow: 0 10px 25px rgba(76, 29, 149, 0.55);
}

.admin-nav-link.active::before {
  background: #fbbf24;
}

/* Quick access subnav (under each section) */
.admin-subnav {
  margin: 0 0 6px 14px;
  padding-left: 8px;
  border-left: 1px dashed rgba(55, 65, 81, 0.7);
  display: none;
  flex-direction: column;
  gap: 4px;
}

.admin-subnav.visible {
  display: flex;
}

.admin-subnav-item {
  background: rgba(15, 23, 42, 0.8);
  border-radius: 999px;
  border: 1px solid rgba(55, 65, 81, 0.8);
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #9ca3af;
  cursor: pointer;
  text-align: left;
}

.admin-subnav-item:hover {
  background: rgba(30, 64, 175, 0.7);
  border-color: rgba(96, 165, 250, 0.9);
  color: #e5e7eb;
}

/* Logout button at bottom */
.logout-btn {
  margin-top: 16px;
  width: 100%;
  justify-content: center;
  background: #991b1b;
  border-color: #7f1d1d;
  color: #fee2e2;
}

.logout-btn:hover {
  background: #b91c1c;
}

/* Fullscreen blocker for non-desktop devices */
#deviceBlocker {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at top, #020617 0%, #000 65%);
  display: none;               /* JS will toggle this */
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* Card inside the blocker */
.device-blocker-card {
  max-width: 420px;
  width: 100%;
  background: rgba(15, 23, 42, 0.97);
  border-radius: 18px;
  padding: 1.75rem 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.25);
  text-align: center;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(15, 23, 42, 0.9);
}

.device-blocker-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.device-blocker-card p {
  margin: 0;
  font-size: 0.95rem;
  color: #e5e7eb;
}

/* Login logo */
#login .login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

#login .login-logo img {
  height: 44px;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.7));
}

/* Mobile Save Button (inside left sidebar) */
.mobile-save-btn {
  width: 100%;
  padding: 12px;
  margin-top: 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  border: none;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: 0.2s ease;
}

.mobile-save-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.mobile-save-btn.unsaved {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #111;
}

.admin-subnav-actions-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin: 0.75rem 0 0.25rem;
}

.admin-subnav-item.admin-subnav-action {
  border-radius: 9999px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
}



/* ============= MAIN CONTENT ============= */

.admin-main {
  background: rgba(15, 23, 42, 0.98);
  border-radius: 18px;
  padding: 18px 18px 20px;
  border: 1px solid rgba(30, 64, 175, 0.4);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.7);
  max-height: calc(100vh - 48px);
  overflow: auto;
}

/* Intro placeholder text */
.admin-intro {
  padding: 12px 4px 16px;
  font-size: 0.95rem;
  color: #9ca3af;
}

/* Sections as tabs */
.admin-section {
  display: none;
  margin-bottom: 1.5rem;
  border-radius: 14px;
  padding: 16px 16px 18px;
  background-color: #020617;
  border: 1px solid #1e293b;
}

.admin-section.active {
  display: block;
}

.admin-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-section-title::before {
  content: "";
  width: 6px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a855f7, #ec4899);
}

/* Field groups for a bit more spacing */
.admin-section label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  display: block;
  margin-top: 6px;
}

/* Variant Image Preview - smaller, clean, consistent */
.variant-image-preview-box {
  width: 60px !important;
  height: 60px !important;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variant-image-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}


/* ============= RIGHT SIDEBAR (SAVE + CONTEXT) ============= */

.admin-rightbar {
  background: radial-gradient(circle at top right, #1e293b 0%, #020617 60%);
  border-radius: 18px;
  padding: 16px 14px 14px;
  border: 1px solid rgba(31, 41, 55, 0.9);
  position: sticky;
  top: 24px;
  align-self: flex-start;
}

.rightbar-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rightbar-section-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
}

.rightbar-section-label::before {
  content: "● ";
  color: #22c55e;
}

/* Context actions (Add Track, Add Merch, etc.) */
.rightbar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rightbar-actions button {
  width: 100%;
  margin: 0;
  font-size: 0.85rem;
  padding: 7px 10px;
}

/* Rightbar progress (mirrors active section progress) */
#rightbarProgress {
  display: none;
}

/* Global save button */
.rightbar-save-btn {
  width: 100%;
  justify-content: center;
  margin-top: 6px;
  background: linear-gradient(135deg, #4c1d95, #7e22ce);
  border-color: transparent;
  color: #f9fafb;
  font-weight: 600;
}

.rightbar-save-btn:hover {
  background: linear-gradient(135deg, #5b21b6, #8b5cf6);
}

.rightbar-save-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #111827;
  border-color: #1f2937;
}

.rightbar-meta {
  font-size: 0.78rem;
  color: #9ca3af;
}

/* Unsaved state: left nav */
.admin-nav-link.unsaved::before {
  background: #f97316; /* orange dot */
}

.admin-nav-link.active.unsaved {
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.9),
    0 12px 30px rgba(249, 115, 22, 0.45);
}

/* Unsaved state: rightbar label + meta */
.rightbar-section-label.unsaved::before {
  color: #f97316;
}

.rightbar-section-label.unsaved {
  color: #fed7aa;
}

.rightbar-meta.unsaved {
  color: #fed7aa;
}


/* ============= BAND MEMBER CARDS ============= */

.band-member {
  border: 1px solid #1f2937;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background-color: #020617;
}

.band-member h4 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Image containers reused across sections */
.photo-container {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 120px;
}

.photo-box span {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9ca3af;
  text-align: center;
}

.photo-box img {
  max-width: 100px;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
}

.no-photo {
  width: 100px;
  height: 100px;
  background-color: #020617;
  border: 1px dashed #374151;
  color: #6b7280;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  font-size: 0.7rem;
  text-align: center;
}

/* File input below images */
.member-photo-input {
  margin-top: 5px;
}

/* ============= MUSIC ITEMS / SHOWS / GALLERY / MERCH CARDS ============= */

.music-item,
.show-item,
.gallery-item,
.merch-item-form {
  border-radius: 10px;
  border: 1px solid #111827;
  background: #020617;
  padding: 12px 12px 14px;
  margin-bottom: 12px;
}

.music-item h4,
.show-item h4,
.gallery-item h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Danger / remove buttons inside cards */
.music-item .remove-music,
.show-item .remove-show,
.gallery-item .remove-gallery-btn,
.merch-item-form .remove-merch-item {
  margin-left: auto;
  display: inline-flex;
}

.merch-item-form {
  border-color: #1f2937;
}

/* Smaller buttons inside content */
.music-item button,
.show-item button,
.gallery-item button,
.merch-item-form button {
  font-size: 0.8rem;
  padding: 6px 12px;
}

/* ===== SHOW SOURCE BADGE (Google Calendar) ===== */

.show-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 2px 9px;
  border-radius: 999px;

  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;

  position: relative;
  overflow: hidden;
  isolation: isolate; /* keep glow inside */
}

/* Specific colourway for gcal-synced shows */
.show-source-badge--gcal {
  color: #e5e7eb;
  background: radial-gradient(
    circle at 0% 0%,
    rgba(168, 85, 247, 0.85) 0%,
    rgba(76, 29, 149, 0.85) 30%,
    #020617 80%
  );
  border: 1px solid rgba(168, 85, 247, 0.7);
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.9),
    0 8px 20px rgba(15, 23, 42, 0.9),
    0 0 18px rgba(168, 85, 247, 0.5);
}

.show-source-badge--gcal::before {
  /* soft pink glow that subtly moves when hovered */
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 0% 50%, rgba(236, 72, 153, 0.45), transparent 55%);
  opacity: 0.6;
  mix-blend-mode: screen;
  pointer-events: none;
}

.show-source-badge:hover {
  transform: translateY(-0.5px);
}

/* Little calendar glyph built with pure CSS */
.show-source-badge__icon {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(248, 250, 252, 0.9);
  background:
    /* header bar */
    linear-gradient(to bottom, rgba(79, 70, 229, 0.95), rgba(129, 140, 248, 0.95)) 0 0 / 100% 40% no-repeat,
    /* body */
    rgba(15, 23, 42, 0.95);
  position: relative;
  box-shadow: 0 0 8px rgba(129, 140, 248, 0.5);
}

.show-source-badge__icon::before,
.show-source-badge__icon::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 4px;
  top: -3px;
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
}

/* "ring" posts */
.show-source-badge__icon::before {
  left: 3px;
}
.show-source-badge__icon::after {
  right: 3px;
}

/* Subtle separator line to hint at calendar rows */
.show-source-badge__icon span {
  display: none; /* no text inside; icon is purely decorative */
}

.show-source-badge__label {
  white-space: nowrap;
}

/* Compact on smaller widths so it doesn’t wrap ugly */
@media (max-width: 900px) {
  .show-source-badge {
    font-size: 0.65rem;
    padding-inline: 7px;
  }

  .show-source-badge__label {
    max-width: 160px;
    text-overflow: ellipsis;
    overflow: hidden;
  }
}


/* ============= GALLERY / MERCH PROGRESS (inline) ============= */

.merch-upload-progress {
  margin-top: 4px;
}

/* ============= RESPONSIVE BEHAVIOUR ============= */

@media (max-width: 1200px) {
  .admin-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    /* still two columns: sidebar + main */
  }

  .admin-rightbar {
    position: static;
    top: auto;
    margin-top: 12px;
    grid-column: 1 / -1;   /* full width under the main panel */
  }
}


@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    margin-bottom: 12px;
  }

  .admin-main {
    max-height: none;
  }
}

/* Chrome, Edge, Safari */
body::-webkit-scrollbar {
  display: none;
}

/* Firefox */
body {
  scrollbar-width: none;
}

/* Full cross-browser */
html, body {
  -ms-overflow-style: none; /* IE & old Edge */
}

/* Toast notifications */
.admin-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

/* Smooth slide/fade animation */
@keyframes toast-slide-in {
  0% { opacity: 0; transform: translateY(-6px) scale(0.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-toast {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  animation: toast-slide-in 0.25s ease;
  
  /* Base theme */
  background: rgba(3, 7, 18, 0.8);
  border-left: 4px solid #6366f1;
  color: #f3f4f6;
  align-items: start;
}

/* Success (green) */
.admin-toast.success {
  border-color: #22c55e;
}

/* Error (red) */
.admin-toast.error {
  border-color: #ef4444;
}

/* Warning (yellow) */
.admin-toast.warning {
  border-color: #eab308;
}

/* Info (blue) */
.admin-toast.info {
  border-color: #3b82f6;
}

.admin-toast-message {
  flex: 1;
  line-height: 1.45;
}

/* Close (×) button */
.admin-toast-close {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1.25rem;
  margin-left: 0.25rem;
  padding: 0;
  transition: color 0.15s ease;
}

.admin-toast-close:hover {
  color: #f3f4f6;
}


/* ---- ICONS FOR TOASTS ---- */
.admin-toast::before {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  mask-size: contain;
  mask-repeat: no-repeat;
  background-color: white; /* icon color */
}

/* Success */
.admin-toast.success::before {
  mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'><path d='M20.285 6.709l-11.1 11.1-5.47-5.47 1.414-1.414 4.056 4.056 9.686-9.686z'/></svg>");
}

/* Error */
.admin-toast.error::before {
  mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'><path d='M18.3 5.71L12 12l6.3 6.29-1.42 1.42L12 14.83l-4.88 4.88-1.42-1.42L9.17 12 4.7 7.53 6.12 6.1 12 12l5.88-5.9z'/></svg>");
}

/* Warning triangle */
.admin-toast.warning::before {
  mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'><path d='M1 21h22L12 2 1 21zm12-3h-2v2h2v-2zm0-6h-2v4h2v-4z'/></svg>");
}

/* Info*/
.admin-toast.info::before {
  mask-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'><path d='M12 2a10 10 0 100 20 10 10 0 000-20zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z'/></svg>");
}


/* 2FA login panel */
.login-mfa-panel {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #e5e7eb;
}

.login-mfa-panel p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #cbd5f5;
}

#loginMfaCode {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  text-align: center;
  margin-bottom: 0.75rem;
}

#loginMfaCode:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.5);
}

.login-mfa-actions {
  display: flex;
  gap: 0.5rem;
}

#loginMfaConfirmBtn {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: none;
  background: #4f46e5;
  color: #f9fafb;
  font-weight: 600;
  cursor: pointer;
}

#loginMfaConfirmBtn:hover {
  background: #4338ca;
}

.login-mfa-cancel {
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
}

.login-mfa-cancel:hover {
  background: rgba(15, 23, 42, 0.8);
}

/* Fade-out for disabling login fields during MFA */
.login-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Loading state for MFA verify button */
#loginMfaConfirmBtn.btn-loading {
  position: relative;
  opacity: 0.7;
  cursor: wait;
  transform: scale(0.98);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.6);
}

/* Spinner inside the button */
#loginMfaConfirmBtn.btn-loading::after {
  content: "";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(239, 246, 255, 0.6);
  border-top-color: transparent;
  border-left-color: transparent;
  animation: login-btn-spin 0.7s linear infinite;
}

/* If button is narrow, adjust spinner position slightly */
#loginMfaConfirmBtn.btn-loading.single-line::after {
  right: 0.6rem;
}

@keyframes login-btn-spin {
  from {
    transform: translateY(-50%) rotate(0deg);
  }
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}
/* 2FA required overlay */
.twofa-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.9), rgba(3, 7, 18, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.twofa-card {
  max-width: 420px;
  width: 100%;
  background: rgba(15, 23, 42, 0.98);
  border-radius: 1.25rem;
  padding: 1.75rem 1.75rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #e5e7eb;
  text-align: left;
  animation: twofa-pop-in 0.22s ease-out;
}

.twofa-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.twofa-card p {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: #cbd5f5;
}

.twofa-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

#twoFaSetupBtn {
  padding: 0.55rem 1.1rem;
  border-radius: 0.75rem;
  border: none;
  background: #4f46e5;
  color: #f9fafb;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
}

#twoFaSetupBtn:hover {
  background: #4338ca;
}

#twoFaLogoutBtn.secondary {
  padding: 0.55rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid #4b5563;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.95rem;
  cursor: pointer;
}

#twoFaLogoutBtn.secondary:hover {
  background: rgba(15, 23, 42, 0.9);
}

@keyframes twofa-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

