/* ==========================================================================
   Auth + paywall modals - shared site-wide
   ========================================================================== */
.fs-modal-overlay {
  position: fixed;
  inset: 0;
  /* Must always sit above the app-shell's bottom sheets (z-index 400/401 in
     app-mobile.css) - a paywall/login prompt should never appear to render
     "behind" whatever sheet triggered it. */
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 21, 30, 0.72);
  backdrop-filter: blur(4px);
}
.fs-modal-overlay[hidden] { display: none; }

.fs-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 30px 60px -20px rgba(5, 21, 30, 0.5);
}

.fs-modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--mist);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fs-modal-close svg { width: 16px; height: 16px; }

.fs-modal-tabs {
  display: inline-flex;
  background: var(--mist);
  border-radius: 999px;
  padding: 0.3rem;
  gap: 0.25rem;
  margin-bottom: 1rem;
}
.fs-modal-tabs button {
  border: none;
  background: transparent;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  color: #4c6975;
}
.fs-modal-tabs button.is-active { background: var(--navy); color: #fff; }

.fs-modal-sub { font-size: 0.85rem; color: #4c6975; line-height: 1.5; margin-bottom: 1.25rem; }

.fs-auth-panel { display: none; }
.fs-auth-panel.is-active { display: block; }
.fs-auth-step[hidden] { display: none; }

.fs-auth-panel label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--navy); margin: 0.9rem 0 0.4rem; }
.fs-auth-panel label:first-child { margin-top: 0; }
.fs-auth-panel input,
.fs-auth-panel select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--mist);
}
.fs-auth-panel input:focus,
.fs-auth-panel select:focus { outline: none; border-color: var(--teal); background: #fff; }
.fs-auth-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.fs-auth-btn { width: 100%; margin-top: 1.1rem; display: flex; align-items: center; justify-content: center; }
.fs-auth-link {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 0.9rem;
  border: none;
  background: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
}
.fs-auth-hint { font-size: 0.88rem; color: #4c6975; }
.fs-auth-error {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #d64545;
}
.fs-auth-error[hidden] { display: none; }
.fs-auth-devcode {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1c7a4a;
  background: #e5f8ee;
  border: 1px solid #bfe8d2;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}
.fs-auth-devcode[hidden] { display: none; }

/* ---- Paywall ---- */
.fs-paywall-modal { text-align: center; }
.fs-paywall-modal h3 { font-size: 1.25rem; color: var(--navy); margin-top: 1.25rem; }
.fs-paywall-modal > .fs-modal-sub { text-align: center; }

.fs-paywall-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.fs-paywall-ring {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: conic-gradient(var(--teal) 360deg, var(--line) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-paywall-ring::after { content: ""; }
.fs-paywall-ring span {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: var(--navy);
  border: 2px solid var(--sky);
}
.fs-paywall-ring-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: #93aab4; }

.fs-paywall-card {
  text-align: left;
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--mist);
  border: 1px solid var(--line);
}
.fs-paywall-card-amber { background: #EAF7FE; border-color: #BEE7FB; }

.fs-paywall-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.8rem;
}
.fs-paywall-badge-blue { background: #dbeafe; color: #1d4ed8; }
.fs-paywall-badge-amber { background: #D6F0FC; color: #075A87; }

.fs-paywall-card-head { display: flex; gap: 0.8rem; align-items: flex-start; }
.fs-paywall-icon {
  width: 38px; height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-paywall-icon svg { width: 19px; height: 19px; }
.fs-paywall-icon-blue { background: #dbeafe; color: #1d4ed8; }
.fs-paywall-icon-amber { background: #D6F0FC; color: #075A87; }
.fs-paywall-card-head h4 { font-size: 0.95rem; color: var(--navy); }
.fs-paywall-card-head p { font-size: 0.82rem; color: #4c6975; margin-top: 0.3rem; line-height: 1.5; }
.fs-paywall-price { font-size: 0.95rem; font-weight: 800; color: #1d4ed8; margin-top: 0.15rem !important; }

.fs-referral-link-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.fs-referral-link-row input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.8rem;
  color: var(--navy);
}
.fs-copy-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  background: #1d4ed8;
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.fs-copy-btn svg { width: 14px; height: 14px; }

.fs-share-row { display: flex; gap: 0.6rem; margin-top: 0.6rem; }
.fs-share-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
}
.fs-share-btn svg { width: 16px; height: 16px; }
#fsWhatsappBtn svg { color: #25d366; }

.fs-paywall-checklist { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 0.5rem; }
.fs-paywall-checklist li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--navy); }
.fs-paywall-checklist li svg { width: 15px; height: 15px; color: #2fae6b; flex-shrink: 0; }

.fs-subscribe-btn { margin-top: 1.5rem; }

.fs-paywall-footnote {
  margin-top: 1rem;
  font-size: 0.76rem;
  color: #93aab4;
  line-height: 1.5;
}
.fs-paywall-footnote span { display: inline-flex; align-items: center; gap: 0.3rem; margin-left: 0.4rem; }
.fs-paywall-footnote svg { width: 12px; height: 12px; }

.fs-paywall-divider {
  text-align: center;
  margin: 1.25rem 0;
  position: relative;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #93aab4;
}
.fs-paywall-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line); }
.fs-paywall-divider span { background: var(--paper); padding: 0 0.75rem; position: relative; }

/* ---- Header logged-in state + account dropdown ---- */
.fs-header-user { position: relative; display: flex; align-items: center; gap: 0.6rem; cursor: pointer; padding: 0.4rem 0.7rem 0.4rem 0.4rem; border-radius: 999px; transition: background 0.2s ease; }
.fs-header-user:hover { background: rgba(255, 255, 255, 0.12); }
.site-header.is-scrolled .fs-header-user:hover { background: rgba(11, 28, 46, 0.08); }
.fs-header-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--teal));
  color: var(--navy-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}
.fs-header-user-email { font-size: 0.88rem; font-weight: 600; color: rgba(255, 255, 255, 0.92); }
.site-header.is-scrolled .fs-header-user-email { color: var(--navy); }
.fs-header-user .chev { width: 14px; height: 14px; color: rgba(255, 255, 255, 0.75); transition: transform 0.25s ease; }
.site-header.is-scrolled .fs-header-user .chev { color: var(--navy); }
.fs-header-user.is-open .chev { transform: rotate(180deg); }

.account-dropdown {
  position: absolute; top: calc(100% + 12px); right: 0; width: 320px;
  background: #fff; border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  border: 1px solid var(--line); padding: 1.25rem; z-index: 200;
}
.account-dropdown-head { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.account-dropdown-head .fs-header-user-avatar { width: 42px; height: 42px; font-size: 1.05rem; }
.account-dropdown-head h4 { font-size: 0.98rem; color: var(--navy); }
.account-dropdown-head p { font-size: 0.8rem; color: #7a97a3; margin-top: 0.15rem; }

.account-plan-badge { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; background: linear-gradient(135deg, rgba(24,192,252,0.14), rgba(24,192,252,0.05)); border: 1px solid rgba(24,192,252,0.35); border-radius: var(--radius-sm); padding: 0.7rem 0.9rem; margin-bottom: 1rem; }
.account-plan-badge.account-plan-badge-free { background: var(--mist); border-color: var(--line); }
.account-plan-badge .plan-name { font-size: 0.85rem; font-weight: 800; color: var(--navy); display: block; }
.account-plan-badge .plan-expiry { font-size: 0.74rem; color: #7a8f45; font-weight: 600; }
.account-plan-badge.account-plan-badge-free .plan-expiry { color: #7a97a3; }
.account-plan-badge .plan-tag { background: var(--amber); color: var(--navy-deep); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.25rem 0.55rem; border-radius: 999px; }
.account-plan-badge .plan-tag.plan-tag-free { background: var(--line); color: #4c6975; }

.account-usage-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1rem; }
.account-usage-item { background: var(--mist); border-radius: var(--radius-sm); padding: 0.65rem 0.75rem; }
.account-usage-item .label { font-size: 0.72rem; font-weight: 700; color: #4c6975; }
.account-usage-item .val { font-size: 0.95rem; font-weight: 800; color: var(--navy); margin-top: 0.15rem; }

.account-dropdown-links { display: flex; flex-direction: column; gap: 0.2rem; }
.account-dropdown-links a, .account-dropdown-links button {
  display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left;
  padding: 0.6rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.88rem; font-weight: 600;
  color: var(--navy); background: none; border: none;
}
.account-dropdown-links a:hover, .account-dropdown-links button:hover { background: var(--mist); }
.account-dropdown-links svg { width: 17px; height: 17px; color: var(--teal); }
.account-dropdown-links .logout-link { color: #c0392b; }
.account-dropdown-links .logout-link svg { color: #c0392b; }

@media (max-width: 640px) {
  .account-dropdown { width: 280px; right: -20px; }
}
