/* ============================================================
   AUTH — Liquid Glass redesign
   Modal, forms, account panels, auth nav links
   ============================================================ */

/* ── Auth nav links (header buttons) ────────────────────── */

.auth-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 18px;
}

.auth-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  color: #111827;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(17, 24, 39, 0.08);
  transition: all 0.18s ease;
  backdrop-filter: blur(12px);
}

.auth-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.auth-link-primary,
.auth-link-primary:visited,
.auth-link-primary:active {
  color: white;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: none;
}

.auth-link-primary:hover {
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ── Support ? button ──────────────────────────────────── */

.nav-support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.18s ease;
  flex-shrink: 0;
  line-height: 1;
  cursor: pointer;
  font-family: "Nunito", system-ui, sans-serif;
}
.nav-support-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.35);
  color: white;
  transform: scale(1.08);
}
.nav-support-btn:visited {
  color: rgba(255, 255, 255, 0.65);
}
.nav-support-btn:hover:visited {
  color: white;
}

/* ── Nav avatar (replaces Account button when logged in) ─── */

.nav-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.nav-avatar-link:hover {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
  transform: scale(1.05);
}

.nav-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

/* ── Overlay & backdrop ──────────────────────────────────── */

.auth-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 99999;
  overflow-y: auto;
  padding: 24px 16px 40px;
  align-items: center;
  justify-content: center;
}

.auth-overlay.open {
  display: flex;
}

.auth-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 20, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

/* ── Modal shell — liquid glass ──────────────────────────── */

.auth-modal {
  position: relative;
  z-index: 2;
  width: min(1120px, 96vw);
  max-height: 92vh;
  margin: 0;
  display: grid;
  grid-template-columns: 400px 1fr;
  min-height: 640px;
  overflow: hidden;
  border-radius: 32px;
  background: rgba(14, 8, 40, 0.82);
  backdrop-filter: blur(60px) saturate(200%);
  -webkit-backdrop-filter: blur(60px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 80px 160px rgba(0, 0, 0, 0.6),
    0 32px 64px rgba(0, 0, 0, 0.4),
    0 0 120px rgba(99, 102, 241, 0.12);
}

/* ── Left panel — vivid gradient orb background ─────────── */

.auth-modal-left {
  position: relative;
  padding: 48px 40px;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 10% 15%, rgba(167, 139, 250, 0.55) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 85%, rgba(79, 70, 229, 0.65) 0%, transparent 50%),
    radial-gradient(ellipse at 65% 5%, rgba(244, 114, 182, 0.35) 0%, transparent 50%),
    radial-gradient(ellipse at 30% 95%, rgba(34, 211, 238, 0.2) 0%, transparent 45%),
    linear-gradient(155deg, #0d0825 0%, #1a0f3c 45%, #0f172a 100%);
}

/* Subtle noise/grain over the gradient */
.auth-modal-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.3;
}

.auth-left-copy {
  display: none;
  position: relative;
  z-index: 1;
  height: 100%;
}

.auth-left-copy.active {
  display: flex;
  flex-direction: column;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 22px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  width: fit-content;
}

.auth-hero-title {
  margin: 0 0 12px;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: white;
}

.auth-hero-copy {
  margin: 0 0 22px;
  line-height: 1.6;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Glass feature list */
.auth-feature-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-feature-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.88);
}

.auth-feature-item::before {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.9), rgba(99, 102, 241, 0.9));
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.5);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Prominent price display */
.auth-price-showcase {
  margin-top: auto;
  padding: 22px 22px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.auth-price-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.auth-price-number {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 4px;
}

.auth-price-currency {
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.auth-price-amount {
  font-size: 2.8rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  letter-spacing: -0.03em;
}

.auth-price-period {
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
  align-self: center;
}

.auth-price-note {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

/* Plan comparison table in left panel (API tab) */
.auth-plan-summary-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 16px 18px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.auth-plan-row:last-child {
  border-bottom: none;
}

.auth-plan-name {
  font-weight: 700;
  color: #fff;
}

.auth-plan-limit {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

/* ── Right panel ─────────────────────────────────────────── */

.auth-modal-right {
  position: relative;
  padding: 40px 44px 36px;
  /* Extra right padding keeps tabs clear of the close button */
  padding-right: 68px;
  background: rgba(255, 255, 255, 0.04);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  overflow-y: auto;
  max-height: 90vh;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 20;          /* above both panels — fixes click-through bug */
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.28);
}

/* ── Tabs ────────────────────────────────────────────────── */

.auth-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 30px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  padding: 9px 8px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.auth-tab.active {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* ── Panels ──────────────────────────────────────────────── */

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-panel h3,
.auth-modal-heading {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.5;
  font-size: 0.82rem;
}

/* ── Forms ───────────────────────────────────────────────── */

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form + .auth-form {
  margin-top: 10px;
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  backdrop-filter: blur(10px);
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-form input:focus {
  border-color: rgba(167, 139, 250, 0.6);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-submit {
  margin-top: 4px;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: white;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow:
    0 10px 30px rgba(99, 102, 241, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.18s ease;
  width: 100%;
  letter-spacing: 0.01em;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 14px 36px rgba(99, 102, 241, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.auth-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.auth-submit-danger {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  box-shadow:
    0 10px 30px rgba(225, 29, 72, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.auth-submit-danger:hover:not(:disabled) {
  box-shadow: 0 14px 36px rgba(225, 29, 72, 0.35),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.auth-submit-secondary {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.auth-submit-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  box-shadow: none;
}

.auth-inline-link {
  border: none;
  background: transparent;
  padding: 0;
  color: rgba(167, 139, 250, 0.9);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s;
}

.auth-inline-link:hover {
  color: #a78bfa;
}

/* ── Account mini-card (glass) ───────────────────────────── */

.account-mini-card {
  display: grid;
  gap: 0;
  margin-bottom: 20px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
}

.account-mini-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.account-mini-row:last-child {
  border-bottom: none;
}

.account-mini-row span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.78rem;
  font-weight: 500;
  flex-shrink: 0;
}

.account-mini-row strong {
  color: white;
  font-size: 0.78rem;
  text-align: right;
  word-break: break-all;
}

/* ── Status pills ────────────────────────────────────────── */

.account-status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-status-pill.active {
  background: rgba(52, 211, 153, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.25);
}

.account-status-pill.inactive,
.account-status-pill.canceled {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Account action buttons ──────────────────────────────── */

/* ── Shared panel footer (logout + delete) ──────────────── */

.auth-panel-footer {
  display: none;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-panel-footer.visible {
  display: flex;
}

.auth-footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  font-family: "Nunito", system-ui, sans-serif;
}

.auth-footer-btn--logout {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.7);
}

.auth-footer-btn--logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.auth-footer-btn--delete {
  background: rgba(225, 29, 72, 0.08);
  border: 1px solid rgba(225, 29, 72, 0.2);
  color: rgba(251, 113, 133, 0.8);
  appearance: none;
  -webkit-appearance: none;
}

.auth-footer-btn--delete:hover {
  background: rgba(225, 29, 72, 0.15);
  color: #fb7185;
}

.auth-account-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.auth-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.auth-action-btn-logout {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.75);
}

.auth-action-btn-logout:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.auth-action-btn-delete {
  border: 1px solid rgba(225, 29, 72, 0.25);
  background: rgba(225, 29, 72, 0.1);
  color: rgba(251, 113, 133, 0.9);
}

.auth-action-btn-delete:hover {
  background: rgba(225, 29, 72, 0.18);
  color: #fb7185;
}

.auth-action-btn-delete-btn {
  appearance: none;
  -webkit-appearance: none;
}

/* ── Pro/Pro Plus plan comparison cards ───────────────────── */
/* (shown in right panel when not subscribed to either) */

.auth-plan-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-plan-option {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.18s ease;
}

.auth-plan-option:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.08);
}

.auth-plan-option.selected {
  border-color: rgba(167, 139, 250, 0.65);
  background: rgba(167, 139, 250, 0.1);
  box-shadow: 0 0 0 4px rgba(167, 139, 250, 0.1);
}

.auth-plan-option-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 8px;
}

.auth-plan-option.selected .auth-plan-option-badge {
  color: #a78bfa;
}

.auth-plan-option-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 4px;
}

.auth-plan-option-currency {
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
}

.auth-plan-option-amount {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  letter-spacing: -0.02em;
}

.auth-plan-option-period {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-left: 2px;
  margin-bottom: 2px;
  align-self: center;
}

.auth-plan-option-features {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.auth-plan-option-feature {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.65);
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-plan-option-feature::before {
  content: "✓";
  font-size: 0.95rem;
  color: #a78bfa;
  font-weight: 800;
  flex-shrink: 0;
}

.auth-plan-best-value {
  position: absolute;
  top: -1px;
  right: 14px;
  padding: 3px 10px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
}

/* ── API plan cards ──────────────────────────────────────── */

.api-plan-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.api-plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.api-plan-card:hover {
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.08);
  color: rgba(255, 255, 255, 0.9);
}

.api-plan-card--selected,
.api-plan-card--current {
  border-color: rgba(167, 139, 250, 0.6);
  background: rgba(167, 139, 250, 0.12);
  color: white;
}

.api-plan-card--current {
  cursor: default;
  opacity: 0.75;
}

.api-plan-card--enterprise {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.45);
  background: transparent;
}

.api-plan-card--enterprise:hover {
  border-color: rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.04);
}

.api-plan-card-name {
  font-weight: 700;
}

.api-plan-card-limit {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.45);
}

.api-plan-card--selected .api-plan-card-limit,
.api-plan-card--current .api-plan-card-limit {
  color: rgba(167, 139, 250, 0.8);
}

.api-plan-card-form {
  display: contents;
}

.api-plan-switcher {
  margin-bottom: 14px;
}

.api-plan-switcher-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.api-plan-picker-intro {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

/* ── Usage meter ─────────────────────────────────────────── */

.api-usage-block {
  margin-bottom: 16px;
}

.api-usage-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 8px;
}

.api-usage-reset {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.35);
}

.api-usage-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.api-usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.api-usage-bar-fill--warning { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.api-usage-bar-fill--danger  { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ── API key display ─────────────────────────────────────── */

.api-key-display {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.72rem;
  word-break: break-all;
  color: rgba(255, 255, 255, 0.8);
}

.api-key-text {
  text-decoration: underline dotted rgba(255, 255, 255, 0.25);
  cursor: copy;
  transition: color 0.12s;
}

.api-key-text:hover { color: white; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 780px) {
  .auth-modal {
    grid-template-columns: 1fr;
    border-radius: 24px;
    min-height: unset;
  }

  .auth-modal-left {
    display: none;
  }

  .auth-modal-right {
    padding: 32px 26px 28px;
    max-height: unset;
    border-left: none;
  }

  .auth-plan-picker-grid {
    grid-template-columns: 1fr;
  }

  .api-plan-cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .auth-tabs {
    flex-wrap: wrap;
  }

  .auth-tab {
    flex: unset;
    font-size: 1rem;
  }

  .api-plan-cards {
    grid-template-columns: 1fr;
  }

  .auth-plan-picker-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Left-panel plan comparison cards ───────────────────── */

.auth-left-plan-card {
  position: relative;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 14px;
}

.auth-left-plan-card--plus {
  background: rgba(167, 139, 250, 0.1);
  border-color: rgba(167, 139, 250, 0.25);
}

.auth-left-plan-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
}

.auth-left-plan-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.auth-left-plan-name {
  font-weight: 800;
  font-size: 0.88rem;
  color: white;
}

.auth-left-plan-features {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Compact price display for left panel cards */
.auth-price-number {
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.auth-price-currency {
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  line-height: 1;
}

.auth-price-amount {
  font-size: 1.5rem;
  font-weight: 900;
  color: white;
  line-height: 1;
  letter-spacing: -0.03em;
}

.auth-price-decimal {
  font-size: 0.78rem;
  font-weight: 700;
  color: white;
  align-self: flex-start;
  margin-top: 4px;
}

.auth-price-period {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  margin-left: 3px;
  margin-bottom: 3px;
  align-self: flex-end;
}

/* ── Right-panel upgrade divider ─────────────────────────── */

.auth-upgrade-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.auth-upgrade-divider::before,
.auth-upgrade-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* Compact plan option (right panel, upgrade context) */
.auth-plan-option--compact {
  margin-bottom: 0;
  padding: 14px 16px;
}

.auth-plan-option--compact .auth-plan-option-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 6px;
}

/* ── Billing interval toggle ────────────────────────────────── */

.billing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px 0;
}

.billing-toggle-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: color 0.18s ease;
  user-select: none;
}

.billing-toggle-label--active {
  color: #fff;
}

.billing-toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  padding: 0;
  transition: all 0.22s ease;
}

.billing-toggle-switch:hover {
  border-color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.12);
}

.billing-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.8);
  transition: all 0.22s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.billing-toggle--annual .billing-toggle-switch {
  background: rgba(167, 139, 250, 0.25);
  border-color: rgba(167, 139, 250, 0.6);
}

.billing-toggle--annual .billing-toggle-knob {
  left: 27px;
  background: #a78bfa;
  box-shadow: 0 1px 6px rgba(167, 139, 250, 0.4);
}

.billing-toggle-save {
  font-size: 0.88rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  opacity: 0.5;
  transition: opacity 0.18s ease;
}

.billing-toggle--annual .billing-toggle-save {
  opacity: 1;
}

/* ── Auth toast / inline message ───────────────────────────── */

.auth-toast {
  display: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 16px;
  animation: authToastIn 0.25s ease-out;
}

.auth-toast.show {
  display: block;
}

.auth-toast--info {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.auth-toast--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

@keyframes authToastIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Loading spinner for Stripe buttons ─────────────────────── */

.auth-submit--loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.auth-submit--loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: authSpinnerRotate 0.6s linear infinite;
}

@keyframes authSpinnerRotate {
  to { transform: rotate(360deg); }
}

/* ── Feature comparison tables ─────────────────────────────── */

.auth-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.auth-compare-table thead th {
  padding: 10px 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.auth-compare-table thead th.auth-compare-feature-col {
  text-align: left;
  padding-left: 16px;
}

.auth-compare-table thead th.auth-compare-highlight {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
}

.auth-compare-table tbody td {
  padding: 8px 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-compare-table tbody td:first-child {
  text-align: left;
  padding-left: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.auth-compare-table tbody tr:last-child td {
  border-bottom: none;
}

/* Highlight paid column background */
.auth-compare-table thead th.auth-compare-highlight,
.auth-compare-table tbody td:last-child {
  background: rgba(167, 139, 250, 0.05);
}

.auth-compare-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(16, 185, 129, 0.25));
  color: #6ee7b7;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

.auth-compare-cross {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
}

.auth-compare-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.auth-compare-text small {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
}

.auth-compare-price-row td {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

/* 4-column table (Free / Pro / Pro+) needs tighter spacing on small left panel */
.auth-compare-table th,
.auth-compare-table td {
  white-space: nowrap;
}

.auth-compare-table td:first-child,
.auth-compare-table th:first-child {
  white-space: normal;
}

/* ── Buy Bitcoin modal ───────────────────────────────────── */

.btc-modal {
  position: relative;
  z-index: 2;
  width: min(960px, 96vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(18, 18, 34, 0.75);
  backdrop-filter: blur(48px) saturate(1.6);
  -webkit-backdrop-filter: blur(48px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 32px 72px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  min-height: 440px;
}

.btc-modal-left {
  position: relative;
  padding: 48px 40px;
  color: white;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 30% 25%, rgba(247, 147, 26, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 50% at 70% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 55%),
    linear-gradient(155deg, #0d0825 0%, #1a0f3c 45%, #0f172a 100%);
}

.btc-modal-left::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
}

.btc-modal-right {
  position: relative;
  padding: 40px 44px 36px;
  overflow-y: auto;
  max-height: 85vh;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.btc-subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  margin: -6px 0 24px;
}

.btc-form-group {
  margin-bottom: 8px;
}

.btc-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
}

.btc-fee-text {
  font-size: 0.92rem;
  color: #a78bfa;
  min-height: 22px;
  margin-bottom: 14px;
  font-weight: 600;
}

.btc-commission-note {
  background: rgba(247, 147, 26, 0.08);
  border: 1px solid rgba(247, 147, 26, 0.18);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
  line-height: 1.5;
}

.btc-commission-note strong {
  color: #f7931a;
}

.btc-powered {
  margin-top: 14px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

@media (max-width: 780px) {
  .btc-modal {
    grid-template-columns: 1fr;
    border-radius: 24px;
    min-height: unset;
  }

  .btc-modal-left {
    display: none;
  }

  .btc-modal-right {
    padding: 32px 26px 28px;
    max-height: unset;
    border-left: none;
  }
}
