/* ═══════════════════════════════════════════════
   FILE: styles/paywall.css
   RESPONSIBILITY: Paywall modal, plan cards,
     sign-in form, status widget on profile page.
   ═══════════════════════════════════════════════ */

/* ── OVERLAY ─────────────────────────────────── */
.pw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pw-overlay.open {
  display: flex;
}

/* ── CARD ────────────────────────────────────── */
.pw-card {
  background: var(--card);
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  animation: pwSlideUp .25s ease;
}

@keyframes pwSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pw-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: .9rem;
  cursor: pointer;
  color: var(--mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.pw-close:hover { background: var(--border); }

/* ── TABS ────────────────────────────────────── */
.pw-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}
.pw-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: .84rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--mid);
  transition: all .15s;
}
.pw-tab.active {
  background: var(--card);
  color: var(--dark);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── PANE ────────────────────────────────────── */
.pw-pane { text-align: center; }
.pw-pane.hidden { display: none; }

.pw-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}
.pw-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}
.pw-sub {
  font-size: .88rem;
  color: var(--mid);
  line-height: 1.5;
  margin-bottom: 22px;
}

/* ── PLAN CARDS ──────────────────────────────── */
.pw-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.pw-plan {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  background: var(--bg);
}
.pw-plan:hover {
  border-color: var(--blue);
}
.pw-plan.sel {
  border-color: var(--blue);
  background: #EFF6FF;
}
.pw-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}
.pw-plan-name {
  font-size: .78rem;
  font-weight: 600;
  color: var(--mid);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pw-plan-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--dark);
}
.pw-plan-price span {
  font-size: .8rem;
  font-weight: 400;
  color: var(--mid);
}
.pw-plan-note {
  font-size: .74rem;
  color: var(--mid);
  margin-top: 3px;
}

/* ── BUTTONS ─────────────────────────────────── */
.pw-btn-pay,
.pw-btn-verify {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-bottom: 12px;
}
.pw-btn-pay:hover,
.pw-btn-verify:hover { opacity: .88; }
.pw-btn-pay:active,
.pw-btn-verify:active { transform: scale(.98); }
.pw-btn-pay:disabled,
.pw-btn-verify:disabled { opacity: .55; cursor: not-allowed; }

.pw-legal {
  font-size: .76rem;
  color: var(--mid);
  line-height: 1.5;
}

/* ── SIGN-IN FORM ────────────────────────────── */
.pw-input {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: .95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--dark);
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border-color .15s;
}
.pw-input:focus {
  outline: none;
  border-color: var(--blue);
}

.pw-err {
  font-size: .82rem;
  color: var(--red);
  margin-top: -4px;
  margin-bottom: 8px;
  text-align: left;
}
.pw-err.hidden { display: none; }

/* ── STATUS WIDGET (profile page) ───────────── */
.pw-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  margin-top: 8px;
}
.pw-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pw-status.active .pw-status-dot { background: var(--green); }
.pw-status.free .pw-status-dot   { background: var(--mid); }

.pw-status-label {
  font-weight: 600;
  font-size: .9rem;
  color: var(--dark);
}
.pw-status-sub {
  font-size: .78rem;
  color: var(--mid);
  margin-top: 1px;
}

.pw-status-upgrade,
.pw-status-signout {
  margin-left: auto;
  padding: 7px 14px;
  border: none;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.pw-status-upgrade {
  background: var(--blue);
  color: #fff;
}
.pw-status-signout {
  background: var(--bg);
  color: var(--mid);
  border: 1.5px solid var(--border);
}
.pw-status-upgrade:hover,
.pw-status-signout:hover { opacity: .8; }

/* ── TRIAL BADGE (shown in setup/nav area) ───── */
.trial-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--mid);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color .15s;
}
.trial-badge:hover { border-color: var(--blue); color: var(--blue); }
.trial-badge.warn  { border-color: var(--gold); color: var(--gold); }
.trial-badge.empty { border-color: var(--red);  color: var(--red); }

/* ── Feature list in upgrade modal (v7.2) ── */
.pw-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
  font-size: 0.92rem;
  color: var(--text-secondary, #555);
}
.pw-feature-list li {
  padding: 5px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.pw-feature-list li:last-child { border-bottom: none; }

/* ── Family Plan card (v7.5) ── */
.pw-plan-family {
  background: linear-gradient(135deg, #faf5ff, #ede9fe);
}
.pw-plan-family.sel {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #ede9fe, #ddd6fe);
  box-shadow: 0 0 0 2px #7c3aed;
}
.pw-plan-badge-family {
  background: #7c3aed !important;
}
.pw-status-children {
  font-size: .78rem;
  color: var(--mid);
  margin-top: 3px;
}
