/**
 * TruthDraft — Authentication UI & Header User Pill Styles
 * Palette: Midnight Slate #1C2B3A, Academic Cobalt #2563EB, Warm Paper #F7F3EC, Terracotta #BD5B3A
 */

/* ── Header Auth Elements ── */
.header-auth-slot {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.header-auth-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.header-coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  background: #F8FAFC;
  border: 1px solid rgba(28, 43, 58, 0.12);
  border-radius: 9999px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.header-coin-badge:hover {
  background: #F1F5F9;
  border-color: rgba(37, 99, 235, 0.3);
  transform: translateY(-0.5px);
}

.header-coin-badge .coin-badge-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-coin-badge .coin-badge-item.bonus {
  color: #B45309;
}

.header-coin-badge .coin-badge-item.priority {
  color: #1D4ED8;
}

.header-coin-badge .coin-badge-sep {
  width: 1px;
  height: 12px;
  background: rgba(28, 43, 58, 0.15);
}

.header-coin-badge .coin-icon {
  width: 13px;
  height: 13px;
}

.auth-nav-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid rgba(28, 43, 58, 0.22);
  background: transparent;
  color: #1C2B3A;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.auth-nav-signin-btn:hover {
  background: rgba(28, 43, 58, 0.06);
  border-color: #1C2B3A;
  color: #1C2B3A;
}

.auth-nav-signin-btn:active {
  transform: translateY(1px);
}

/* Skeleton Loading Pill (prevents header flash) */
.auth-skeleton-pill {
  width: 76px;
  height: 34px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(28, 43, 58, 0.06) 25%, rgba(28, 43, 58, 0.12) 50%, rgba(28, 43, 58, 0.06) 75%);
  background-size: 200% 100%;
  animation: auth-shimmer 1.5s infinite;
}

@keyframes auth-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Logged-In User Pill (SaaS Grade) */
.auth-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  border-radius: 9999px;
  border: 1px solid rgba(28, 43, 58, 0.18);
  background: #ffffff;
  color: #1C2B3A;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.auth-user-pill:hover,
.auth-user-pill[aria-expanded="true"] {
  border-color: #2563EB;
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
  transform: translateY(-0.5px);
}

.auth-user-avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.auth-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  background: #1C2B3A;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  flex-shrink: 0;
  border: 1.5px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.auth-user-status-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  border: 1.5px solid #ffffff;
}

.auth-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #1C2B3A;
  font-size: 13px;
}

.auth-user-chevron {
  width: 12px;
  height: 12px;
  color: #64748b;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-user-pill[aria-expanded="true"] .auth-user-chevron {
  transform: rotate(180deg);
  color: #2563EB;
}

/* ── GPTZero-Class Profile Popover Dropdown (340px) ────────────────────────── */
.auth-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: min(340px, calc(100vw - 24px));
  background: #ffffff;
  border: 1px solid rgba(28, 43, 58, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(28, 43, 58, 0.05);
  padding: 16px;
  z-index: 200;
  display: none;
  flex-direction: column;
  gap: 12px;
  box-sizing: border-box;
  animation: auth-dropdown-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-dropdown-menu.is-open {
  display: flex;
}

@keyframes auth-dropdown-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Profile Summary Top Card */
.auth-dropdown-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(28, 43, 58, 0.08);
}

.auth-dropdown-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.auth-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  background: #1C2B3A;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  flex-shrink: 0;
}

.auth-avatar-verified {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #10B981;
  color: #ffffff;
  border: 2px solid #ffffff;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.auth-avatar-verified svg {
  width: 10px;
  height: 10px;
}

.auth-dropdown-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-dropdown-user-name {
  font-size: 15px;
  font-weight: 700;
  color: #1C2B3A;
  line-height: 1.25;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-user-email {
  font-size: 12px;
  color: #64748B;
  margin: 0 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-dropdown-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 8px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  color: #2563EB;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-plan-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563EB;
}

.auth-dropdown-warn-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 12px;
  background: rgba(189, 91, 58, 0.1);
  color: #BD5B3A;
  font-size: 10px;
  font-weight: 700;
}

/* Wallet Card in Profile Dropdown */
.auth-dropdown-wallet-box {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-wallet-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.auth-wallet-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-wallet-divider {
  width: 1px;
  height: 36px;
  background: #E2E8F0;
}

.auth-wallet-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-wallet-value {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
}

.auth-wallet-value.bonus {
  color: #D97706;
}

.auth-wallet-value.priority {
  color: #2563EB;
}

.auth-wallet-sub {
  font-size: 10.5px;
  color: #94A3B8;
}

.auth-wallet-buy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 6px;
  background: #2563EB;
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
}

.auth-wallet-buy-btn:hover {
  background: #1D4ED8;
  color: #FFFFFF !important;
}

/* Action Items List */
.auth-dropdown-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.auth-dropdown-item:hover {
  background: rgba(28, 43, 58, 0.05);
  color: #1C2B3A;
}

.auth-dropdown-item svg {
  width: 16px;
  height: 16px;
  color: #64748b;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.auth-dropdown-item:hover svg {
  color: #1C2B3A;
}

.auth-item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.auth-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1C2B3A;
  line-height: 1.25;
}

.auth-item-sub {
  font-size: 11px;
  color: #64748B;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown-item-warning {
  background: rgba(189, 91, 58, 0.05);
  border: 1px solid rgba(189, 91, 58, 0.16);
  margin-bottom: 4px;
}

.auth-dropdown-item-warning:hover {
  background: rgba(189, 91, 58, 0.1);
}

.auth-dropdown-item-warning .auth-item-title {
  color: #BD5B3A;
}

.auth-dropdown-item-warning svg {
  color: #BD5B3A;
}

.auth-dropdown-divider {
  height: 1px;
  background: rgba(28, 43, 58, 0.08);
  margin: 2px 0;
}

.auth-dropdown-footer {
  padding-top: 2px;
}

.auth-dropdown-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(189, 91, 58, 0.2);
  color: #BD5B3A;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-dropdown-logout-btn:hover {
  background: rgba(189, 91, 58, 0.08);
  border-color: rgba(189, 91, 58, 0.35);
  color: #BD5B3A;
}

.auth-dropdown-logout-btn svg {
  width: 14px;
  height: 14px;
  color: #BD5B3A;
}

/* ── Auth Modal & Backdrop ───────────────────────────────── */
.truthdraft-auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.truthdraft-auth-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.truthdraft-auth-modal {
  width: min(100%, 430px);
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(28, 43, 58, 0.14);
  box-shadow: 0 24px 48px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(28, 43, 58, 0.05);
  padding: 28px 30px;
  position: relative;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.truthdraft-auth-backdrop.is-active .truthdraft-auth-modal {
  transform: scale(1) translateY(0);
}

.auth-modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.auth-modal-close-btn:hover {
  background: rgba(28, 43, 58, 0.06);
  color: #1C2B3A;
}

.auth-modal-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #BD5B3A;
  margin-bottom: 6px;
}

.auth-modal-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #BD5B3A;
}

.auth-modal-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: #1C2B3A;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 6px;
}

.auth-modal-subtitle {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 20px;
  line-height: 1.5;
}

/* Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid rgba(28, 43, 58, 0.1);
  margin-bottom: 20px;
  gap: 4px;
}

.auth-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.auth-tab-btn:hover {
  color: #1C2B3A;
}

.auth-tab-btn.is-active {
  color: #2563EB;
  border-bottom-color: #2563EB;
}

/* Google Sign-in Button */
.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid rgba(28, 43, 58, 0.18);
  background: #ffffff;
  color: #1C2B3A;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.auth-google-btn:hover {
  background: #f8fafc;
  border-color: rgba(28, 43, 58, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.auth-google-btn:active {
  transform: translateY(1px);
}

.auth-google-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Separator */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(28, 43, 58, 0.1);
}

/* Form Styles */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.auth-label {
  font-size: 12px;
  font-weight: 650;
  color: #1C2B3A;
}

.auth-link {
  font-size: 11.5px;
  font-weight: 600;
  color: #2563EB;
  text-decoration: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border-radius: 7px;
  border: 1px solid rgba(28, 43, 58, 0.2);
  background: #fbfaf7;
  color: #1C2B3A;
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #2563EB;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.auth-input.has-toggle {
  padding-right: 38px;
}

.auth-pw-toggle {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.auth-pw-toggle:hover {
  color: #1C2B3A;
}

.auth-pw-toggle svg {
  width: 15px;
  height: 15px;
}

/* Error & Notice Banners */
.auth-banner {
  display: none;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.5;
  animation: auth-fade-in 0.15s ease;
}

.auth-banner.is-visible {
  display: flex;
}

@keyframes auth-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-banner-error {
  background: rgba(189, 91, 58, 0.08);
  border: 1px solid rgba(189, 91, 58, 0.25);
  color: #99371b;
}

.auth-banner-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
}

.auth-banner-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Submit Button */
.auth-submit-btn {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  border-radius: 8px;
  border: none;
  background: #BD5B3A;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(189, 91, 58, 0.25);
}

.auth-submit-btn:hover {
  background: #a94e30;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(189, 91, 58, 0.35);
}

.auth-submit-btn:active {
  transform: translateY(1px);
}

.auth-submit-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Spinner */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Terms note in modal */
.auth-terms-note {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 14px;
  line-height: 1.5;
}

.auth-terms-note a {
  color: #64748b;
  text-decoration: underline;
}

/* Mobile drawer Sign-in item */
.mobile-auth-wrapper {
  padding: 12px 0 6px;
}

.mobile-auth-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 6px;
  background: #2563EB;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mobile-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(28, 43, 58, 0.05);
  margin-bottom: 8px;
}

.mobile-user-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-user-signout-btn {
  background: transparent;
  border: none;
  color: #BD5B3A;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

/* ── Dark Mode Adaptations ───────────────────────────────── */
html.dark .auth-nav-signin-btn {
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

html.dark .auth-nav-signin-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #f8fafc;
}

html.dark .auth-user-pill {
  border-color: rgba(255, 255, 255, 0.16);
  background: #111827;
  color: #f8fafc;
}

html.dark .auth-user-pill:hover,
html.dark .auth-user-pill[aria-expanded="true"] {
  border-color: #3b82f6;
  background: #1e293b;
}

html.dark .auth-user-avatar {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.15);
}

html.dark .auth-dropdown-menu {
  background: #111827;
  border-color: #1f293d;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

html.dark .auth-dropdown-header {
  border-bottom-color: #1f293d;
}

html.dark .auth-dropdown-user-name {
  color: #f8fafc;
}

html.dark .auth-dropdown-item {
  color: #cbd5e1;
}

html.dark .auth-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

html.dark .auth-dropdown-divider {
  background: #1f293d;
}

html.dark .auth-dropdown-profile-card {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

html.dark .auth-avatar-large {
  border-color: #111827;
  background: #1e293b;
}

html.dark .auth-dropdown-usage-box {
  background: #182232;
  border-color: #24324a;
}

html.dark .auth-usage-top-row {
  color: #f8fafc;
}

html.dark .auth-usage-label {
  color: #94a3b8;
}

html.dark .auth-usage-count strong {
  color: #f8fafc;
}

html.dark .auth-progress-track {
  background: #24324a;
}

html.dark .auth-item-title {
  color: #f8fafc;
}

html.dark .auth-item-sub {
  color: #94a3b8;
}

html.dark .auth-dropdown-upgrade-card {
  background: linear-gradient(135deg, rgba(189, 91, 58, 0.15) 0%, rgba(220, 123, 89, 0.08) 100%);
  border-color: rgba(189, 91, 58, 0.35);
}

html.dark .auth-upgrade-title {
  color: #f8fafc;
}

html.dark .auth-upgrade-subtitle {
  color: #94a3b8;
}

html.dark .auth-dropdown-logout-btn {
  border-color: rgba(189, 91, 58, 0.35);
}

html.dark .auth-dropdown-logout-btn:hover {
  background: rgba(189, 91, 58, 0.15);
}

html.dark .truthdraft-auth-modal {
  background: #111827;
  border-color: #1f293d;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.6);
}

html.dark .auth-modal-title {
  color: #f8fafc;
}

html.dark .auth-tab-btn {
  color: #94a3b8;
}

html.dark .auth-tab-btn.is-active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

html.dark .auth-google-btn {
  background: #1e293b;
  border-color: #334155;
  color: #f8fafc;
}

html.dark .auth-google-btn:hover {
  background: #283548;
}

html.dark .auth-divider::before,
html.dark .auth-divider::after {
  background: #1f293d;
}

html.dark .auth-label {
  color: #f8fafc;
}

html.dark .auth-input {
  background: #0f172a;
  border-color: #334155;
  color: #f8fafc;
}

html.dark .auth-input:focus {
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* ── Custom Action Page (auth-action.html / auth.truthdraft.com) ─── */
.action-page-main {
  min-height: calc(100vh - 340px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
  background: var(--site-bg, #F7F3EC);
}

.action-card {
  width: 100%;
  max-width: 480px;
  background: var(--site-panel, #FFFFFF);
  border: 1px solid var(--site-border, #E2DACD);
  border-radius: var(--radius-card, 16px);
  padding: 40px 32px;
  box-shadow: 0 16px 40px -12px rgba(28, 43, 58, 0.08);
  text-align: center;
}

.action-icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px auto;
}

.action-icon-badge--success {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.action-icon-badge--cobalt {
  background: #eff6ff;
  color: var(--academic-cobalt, #2563EB);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.action-icon-badge--error {
  background: #fef2f2;
  color: var(--brand-terracotta, #BD5B3A);
  border: 1px solid rgba(189, 91, 58, 0.25);
}

.action-card-title {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--site-ink, #1C2B3A);
  margin-bottom: 12px;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.action-card-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--site-copy, #4B5563);
  margin-bottom: 24px;
}

.action-form {
  text-align: left;
}

html.dark .action-page-main {
  background: #0f172a;
}

html.dark .action-card {
  background: #1e293b;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.45);
}

html.dark .action-card-title {
  color: #F8FAFC;
}

html.dark .action-card-desc {
  color: #94A3B8;
}

html.dark .action-icon-badge--success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

html.dark .action-icon-badge--cobalt {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
}

html.dark .action-icon-badge--error {
  background: rgba(189, 91, 58, 0.2);
  color: #f87171;
}

/* ── Email Verification Sent View (Modal) ───────────────────────── */
.auth-verify-view {
  text-align: center;
  padding: 6px 4px 10px 4px;
  animation: auth-fade-in 0.2s ease;
}

.auth-verify-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: var(--academic-cobalt, #2563EB);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px auto;
}

.auth-verify-icon svg {
  width: 26px;
  height: 26px;
}

.auth-verify-title {
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--site-ink, #1C2B3A);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}

.auth-verify-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--site-copy, #4B5563);
  margin-bottom: 14px;
}

.auth-verify-desc strong {
  color: var(--academic-cobalt, #2563EB);
  font-weight: 600;
  word-break: break-all;
}

.auth-verify-box {
  background: rgba(28, 43, 58, 0.03);
  border: 1px solid rgba(28, 43, 58, 0.08);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--site-copy, #4B5563);
  margin-bottom: 18px;
  text-align: left;
}

.auth-verify-resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--site-copy, #64748b);
  margin-top: 14px;
  flex-wrap: wrap;
}

.auth-banner-resend-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #99371b;
  background: rgba(189, 91, 58, 0.12);
  border: 1px solid rgba(189, 91, 58, 0.3);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-banner-resend-btn:hover {
  background: rgba(189, 91, 58, 0.22);
}

html.dark .auth-verify-icon {
  background: rgba(37, 99, 235, 0.18);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.3);
}

html.dark .auth-verify-title {
  color: #F8FAFC;
}

html.dark .auth-verify-desc {
  color: #94A3B8;
}

html.dark .auth-verify-desc strong {
  color: #93c5fd;
}

html.dark .auth-verify-box {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
  color: #94A3B8;
}

html.dark .auth-verify-resend-row {
  color: #94A3B8;
}

html.dark .auth-banner-resend-btn {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
}



/* ── Feature Modals (Scan History & Pro Upgrade) ─────────── */
.truthdraft-feature-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.truthdraft-feature-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.truthdraft-feature-dialog {
  width: min(100%, 540px);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(28, 43, 58, 0.14);
  box-shadow: 0 24px 56px -12px rgba(15, 23, 42, 0.3), 0 0 0 1px rgba(28, 43, 58, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 90vh;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.truthdraft-feature-backdrop.is-open .truthdraft-feature-dialog {
  transform: translateY(0) scale(1);
}

.truthdraft-feature-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid rgba(28, 43, 58, 0.08);
  background: #ffffff;
}

.truthdraft-dialog-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.truthdraft-dialog-title-wrap svg {
  color: #BD5B3A;
}

.truthdraft-dialog-title-wrap h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 19px;
  font-weight: 700;
  color: #1C2B3A;
  margin: 0;
  letter-spacing: -0.01em;
}

.truthdraft-dialog-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748B;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.truthdraft-dialog-close-btn:hover {
  background: rgba(28, 43, 58, 0.06);
  color: #1C2B3A;
}

.truthdraft-feature-dialog-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* History Modal States */
.truthdraft-empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 12px 12px;
  gap: 10px;
}

.truthdraft-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(189, 91, 58, 0.08);
  color: #BD5B3A;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}

.truthdraft-empty-history h4 {
  font-size: 16px;
  font-weight: 700;
  color: #1C2B3A;
  margin: 0;
}

.truthdraft-empty-history p {
  font-size: 13px;
  color: #64748B;
  line-height: 1.5;
  max-width: 380px;
  margin: 0 0 12px;
}

.truthdraft-empty-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.truthdraft-dialog-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  background: #BD5B3A;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(189, 91, 58, 0.25);
}

.truthdraft-dialog-action-btn:hover {
  background: #a94e30;
  transform: translateY(-1px);
  color: #ffffff;
}

.truthdraft-dialog-action-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  background: transparent;
  color: #1C2B3A;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(28, 43, 58, 0.18);
  transition: all 0.15s ease;
}

.truthdraft-dialog-action-ghost:hover {
  background: rgba(28, 43, 58, 0.05);
}

/* History List Items */
.truthdraft-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.truthdraft-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.truthdraft-history-item-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.truthdraft-history-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
  width: fit-content;
}

.truthdraft-history-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1C2B3A;
}

.truthdraft-history-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #64748B;
}

.truthdraft-history-score {
  font-size: 12.5px;
  font-weight: 700;
  color: #BD5B3A;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(189, 91, 58, 0.08);
}

/* Pro Modal Styles */
.truthdraft-pro-dialog {
  width: min(100%, 600px);
}

.truthdraft-pro-badge-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: #BD5B3A;
  color: #ffffff;
  display: grid;
  place-items: center;
}

.truthdraft-pro-intro h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 17px;
  font-weight: 700;
  color: #1C2B3A;
  margin: 0 0 6px;
}

.truthdraft-pro-intro p {
  font-size: 13px;
  color: #64748B;
  margin: 0;
  line-height: 1.5;
}

.truthdraft-pro-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 600px) {
  .truthdraft-pro-features-grid {
    grid-template-columns: 1fr;
  }
}

.truthdraft-pro-feature {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.truthdraft-pro-feat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(189, 91, 58, 0.1);
  color: #BD5B3A;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.truthdraft-pro-feature h5 {
  font-size: 13px;
  font-weight: 700;
  color: #1C2B3A;
  margin: 0 0 3px;
}

.truthdraft-pro-feature p {
  font-size: 11.5px;
  color: #64748B;
  margin: 0;
  line-height: 1.45;
}

.truthdraft-pro-footer-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(28, 43, 58, 0.08);
}

/* Dark Mode for Feature Modals */
html.dark .truthdraft-feature-dialog {
  background: #111827;
  border-color: #1f293d;
  box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.7);
}

html.dark .truthdraft-feature-dialog-header {
  background: #111827;
  border-bottom-color: #1f293d;
}

html.dark .truthdraft-dialog-title-wrap h3 {
  color: #f8fafc;
}

html.dark .truthdraft-dialog-close-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

html.dark .truthdraft-empty-history h4,
html.dark .truthdraft-pro-intro h4,
html.dark .truthdraft-pro-feature h5,
html.dark .truthdraft-history-title {
  color: #f8fafc;
}

html.dark .truthdraft-dialog-action-ghost {
  border-color: rgba(255, 255, 255, 0.2);
  color: #f8fafc;
}

html.dark .truthdraft-dialog-action-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

html.dark .truthdraft-pro-feature,
html.dark .truthdraft-history-item {
  background: #182232;
  border-color: #24324a;
}

html.dark .truthdraft-pro-footer-cta {
  border-top-color: #1f293d;
}
