/* ============================================================
   ViViDly Legal & Payment Pages — Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.08);
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #4facfe;
  --accent2: #a78bfa;
  --green: #4ade80;
  --orange: #fb923c;
  --red: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Outfit', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.7;
}

/* Background bubbles (same as main app) */
.bg-bubbles { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bubble {
  position: absolute; border-radius: 50%; opacity: 0.18;
  animation: float 20s infinite ease-in-out;
}
.bubble-1 { width: 400px; height: 400px; background: radial-gradient(#4facfe, #00f2fe); top: -100px; left: -100px; animation-delay: 0s; }
.bubble-2 { width: 300px; height: 300px; background: radial-gradient(#a18cd1, #fbc2eb); top: 60%; right: -80px; animation-delay: -7s; }
.bubble-3 { width: 250px; height: 250px; background: radial-gradient(#43e97b, #38f9d7); bottom: -80px; left: 40%; animation-delay: -14s; }
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

/* ===== TOP NAV ===== */
.top-nav-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 60px;
  background: rgba(15,23,42,0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
  font-weight: 700; font-size: 17px;
}
.nav-brand img { height: 32px; width: 32px; border-radius: 50%; background: white; padding: 3px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: 8px; transition: all 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }
.nav-link.active { color: var(--accent); background: rgba(79,172,254,0.08); }
.nav-btn-home {
  background: var(--accent); color: #0f172a; font-weight: 700;
  border: none; padding: 7px 16px; border-radius: 10px;
  text-decoration: none; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.nav-btn-home:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ===== MAIN WRAPPER ===== */
.page-wrapper {
  position: relative; z-index: 1;
  max-width: 880px; margin: 0 auto;
  padding: 48px 24px 80px;
}
.page-wrapper.wide { max-width: 1100px; }

/* ===== PAGE HEADER ===== */
.page-hero {
  text-align: center; padding: 48px 24px 40px; margin-bottom: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(12px);
}
.page-hero .hero-icon {
  font-size: 48px; margin-bottom: 12px; display: block;
}
.page-hero h1 {
  font-size: 2.2rem; font-weight: 700; margin-bottom: 10px;
  background: linear-gradient(135deg, #4facfe 0%, #a78bfa 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.page-hero .meta {
  font-size: 13px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
}
.page-hero .meta span { display: flex; align-items: center; gap: 4px; }

/* ===== SECTIONS ===== */
.section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 32px; margin-bottom: 20px;
}
.section h2 {
  font-size: 1.15rem; font-weight: 700; color: var(--accent);
  margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.section h2 .material-icons-outlined { font-size: 20px; }
.section h3 { font-size: 1rem; font-weight: 600; color: #c7d2fe; margin: 16px 0 8px; }
.section p { color: var(--text-muted); font-size: 14.5px; margin-bottom: 10px; }
.section ul, .section ol { padding-left: 20px; color: var(--text-muted); font-size: 14.5px; }
.section li { margin-bottom: 6px; }
.section a { color: var(--accent); text-decoration: none; }
.section a:hover { text-decoration: underline; }
.highlight {
  background: rgba(79,172,254,0.08); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 14px; color: var(--text);
}
.warning-box {
  background: rgba(251,146,60,0.1); border-left: 3px solid var(--orange);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 14px; color: #fed7aa;
}
.danger-box {
  background: rgba(248,113,113,0.1); border-left: 3px solid var(--red);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 14px; color: #fecaca;
}
.success-box {
  background: rgba(74,222,128,0.1); border-left: 3px solid var(--green);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 14px 0;
  font-size: 14px; color: #bbf7d0;
}

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; margin: 14px 0; border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: rgba(79,172,254,0.12); color: var(--accent); padding: 10px 14px; text-align: left; font-weight: 600; }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-hover); }

/* ===== FOOTER ===== */
.page-footer {
  text-align: center; padding: 28px 24px 32px;
  border-top: 1px solid var(--border); margin-top: 60px;
  position: relative; z-index: 1;
}
.page-footer p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 6px; line-height: 1.8; }
.page-footer a { color: var(--accent); text-decoration: none; }
.page-footer a:hover { text-decoration: underline; }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin-top: 14px;
}
.footer-links a { font-size: 12px; color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.footer-sep { color: var(--border); }

/* ===== BACK BUTTON ===== */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-muted); text-decoration: none; font-size: 13px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  transition: all 0.2s; margin-bottom: 24px; background: var(--surface);
}
.back-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(79,172,254,0.06); }

/* ===== LEGAL SUITE CARDS ===== */
.legal-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 32px;
}
.legal-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  text-decoration: none; color: var(--text);
  transition: all 0.25s; display: flex; flex-direction: column; gap: 10px;
  position: relative; overflow: hidden;
}
.legal-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(79,172,254,0.06) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.25s;
}
.legal-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.legal-card:hover::before { opacity: 1; }
.legal-card .card-icon { font-size: 32px; }
.legal-card .card-title { font-size: 1rem; font-weight: 700; color: var(--text); }
.legal-card .card-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.legal-card .card-arrow {
  margin-top: auto; padding-top: 10px; font-size: 13px;
  color: var(--accent); display: flex; align-items: center; gap: 4px;
}

/* ===== PAYMENT PAGE ===== */
.plans-header { text-align: center; margin-bottom: 32px; }
.billing-toggle-wrap {
  display: inline-flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: 50px; padding: 4px; gap: 4px; margin-top: 16px;
}
.bill-btn {
  padding: 8px 22px; border: none; border-radius: 50px; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.2s;
  background: transparent; color: var(--text-muted);
}
.bill-btn.active { background: var(--accent); color: #0f172a; }
.save-pill {
  font-size: 11px; background: var(--green); color: #0f172a;
  padding: 2px 8px; border-radius: 50px; font-weight: 700; margin-left: 4px;
}

.pricing-wrap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px; margin: 32px 0;
}
.plan-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 22px;
  display: flex; flex-direction: column; gap: 6px; position: relative;
  transition: all 0.25s;
}
.plan-card.featured {
  border-color: var(--accent); background: rgba(79,172,254,0.06);
  transform: scale(1.02);
}
.plan-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.35); }
.plan-card.featured:hover { transform: scale(1.02) translateY(-4px); }
.plan-badge {
  position: absolute; top: -1px; right: 20px;
  background: var(--accent); color: #0f172a;
  font-size: 11px; font-weight: 800; padding: 3px 10px;
  border-radius: 0 0 8px 8px; letter-spacing: 0.5px;
}
.plan-badge.green { background: var(--green); }
.plan-badge.purple { background: var(--accent2); }
.plan-badge.orange { background: var(--orange); }
.plan-name { font-size: 1.1rem; font-weight: 700; margin-top: 8px; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; margin: 10px 0 2px; }
.plan-price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.plan-period { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }
.plan-features { list-style: none; padding: 0; font-size: 13.5px; color: var(--text-muted); flex: 1; }
.plan-features li {
  padding: 5px 0; display: flex; align-items: flex-start; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features .material-icons-outlined { font-size: 16px; color: var(--green); flex-shrink: 0; margin-top: 2px; }
.plan-features .material-icons-outlined.off { color: #475569; }
.plan-features li.off { opacity: 0.5; }
.plan-btn {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer; margin-top: 16px;
  transition: all 0.2s; background: var(--surface-hover);
  color: var(--text); border: 1px solid var(--border);
}
.plan-btn.primary { background: var(--accent); color: #0f172a; border-color: var(--accent); }
.plan-btn.primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.plan-btn:hover { background: rgba(255,255,255,0.1); }
.plan-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.payment-methods {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0;
  justify-content: center;
}
.pay-method {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  padding: 8px 16px; border-radius: 10px; font-size: 13px; color: var(--text-muted);
}
.pay-method .material-icons-outlined { font-size: 18px; color: var(--accent); }

.trust-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 20px;
  padding: 24px; background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); margin: 28px 0;
}
.trust-item { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.trust-item .material-icons-outlined { font-size: 18px; color: var(--green); }

.faq-list { margin-top: 16px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  padding: 14px 0; cursor: pointer; font-size: 14.5px; font-weight: 500;
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text); transition: color 0.2s; user-select: none;
  /* button reset */
  width: 100%; background: none; border: none; text-align: left;
  font-family: inherit; line-height: inherit; outline: none;
}
.faq-q:hover { color: var(--accent); }
.faq-a { font-size: 13.5px; color: var(--text-muted); padding: 0 0 14px; display: none; line-height: 1.7; }
.faq-item.open .faq-q { color: var(--accent); }
.faq-item.open .faq-a { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .top-nav-bar { padding: 0 16px; }
  .nav-links { display: none; }
  .page-wrapper { padding: 28px 16px 60px; }
  .page-hero h1 { font-size: 1.6rem; }
  .section { padding: 20px 18px; }
  .pricing-wrap { grid-template-columns: 1fr; }
  .plan-card.featured { transform: scale(1); }
  .legal-grid { grid-template-columns: 1fr; }
}
