/* ==========================================================
   Zipsom.com — Java E-Book Store
   Design system matches the approved reference:
   Font: Poppins | Accent: #2563eb | Ink: #0f172a
   ========================================================== */

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

:root {
  --bg: #f8fafc;
  --ink: #0f172a;
  --ink-dim: #475569;
  --ink-soft: #334155;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-2: #16a34a;
  --line: #e5e7eb;
  --radius: 8px;
  --font-body: 'Poppins', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  /* Header and footer are our dark bookend style */
  --dark-bg: #0f1522;
  --dark-ink: #f2f4f7;
  --dark-ink-dim: #93a0b4;
  --dark-line: #232b3d;
}

html {
  scroll-behavior: smooth;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

a { color: inherit; }
code {
  font-family: var(--font-mono);
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.88em;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- HEADER (dark bookend style) ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--dark-bg);
  border-bottom: 1px solid var(--dark-line);
}
.logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo img { height: 32px; width: auto; }
.logo .logo-dot { color: var(--accent); }
nav a, .nav-btn-link {
  text-decoration: none;
  margin-left: 24px;
  color: var(--dark-ink-dim);
  font-weight: 600;
  font-size: 15px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color 0.15s ease;
}
nav a:hover, .nav-btn-link:hover { color: var(--dark-ink); }

/* ---------- HERO ---------- */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 40px 20px;
  background: linear-gradient(#fff, #eff6ff);
  min-height: 0;
}
.hero-wrap {
  max-width: 1200px;
  margin: auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
.badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 46px;
  font-weight: 700;
  line-height: 1.12;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.hero p {
  font-size: 17px;
  color: var(--ink-dim);
  margin-bottom: 22px;
  max-width: 600px;
  line-height: 1.6;
}
.price-line {
  font-size: 14px;
  color: var(--ink-dim);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.price-line .was { text-decoration: line-through; opacity: 0.6; }
.price-line .save {
  background: rgba(22,163,74,0.1);
  color: var(--accent-2);
  font-weight: 700;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 20px;
}
.price-line .local-fx {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-dim);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.loader-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-dim);
  animation: pulse 1.2s infinite ease-in-out;
}
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  padding: 15px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  border: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(37,99,235,0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(37,99,235,0.3); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.cta-meta {
  display: flex;
  gap: 16px;
  color: var(--ink-dim);
  font-size: 12.5px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.card {
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.card h2 { margin-bottom: 15px; font-size: 21px; font-weight: 700; }
.card ul { padding-left: 18px; line-height: 2; color: var(--ink-soft); font-size: 15px; }

/* ---------- FAQ MODAL ---------- */
.pay-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.pay-overlay[hidden] { display: none; }
.pay-overlay-box { text-align: center; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#pay-overlay-text { color: var(--ink-dim); font-size: 14px; }

.faq-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px;
  max-width: 560px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}
.faq-close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: var(--ink-dim);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}
.faq-close:hover { color: var(--ink); }
.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14.5px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--accent); font-size: 20px; }
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { color: var(--ink-dim); font-size: 13.5px; margin-top: 12px; line-height: 1.6; }

/* ---------- FOOTER ---------- */
footer {
  background: var(--dark-bg);
  color: #fff;
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid var(--dark-line);
}
footer .container {
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0;
  flex-wrap: nowrap;
}
footer p { color: #fff; font-size: 12px; margin: 0; }
.footer-links { display: flex; align-items: center; gap: 14px; font-size: 11.5px; }
.footer-links { display: flex; gap: 16px; font-size: 12.5px; }
.footer-links a { color: #94a3b8; text-decoration: none; }
.footer-links a:hover { color: #fff; }
.footer-sep { color: #334155; }

/* ---------- LEGAL PAGES ----------
   Header and footer stay fixed on screen; only the long legal text
   scrolls internally, so the page itself never shows a scrollbar. */
.legal-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.legal-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 24px;
}
.legal-eyebrow { color: var(--accent); font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.legal-wrap h1 { font-size: 30px; font-weight: 700; margin-bottom: 8px; }
.legal-updated { color: var(--ink-dim); font-size: 13px; margin-bottom: 36px; }
.legal-content h2 { font-size: 20px; font-weight: 700; margin: 32px 0 10px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { color: var(--ink-dim); font-size: 15px; line-height: 1.75; margin-bottom: 14px; }
.legal-content ul { color: var(--ink-dim); font-size: 15px; line-height: 1.75; margin-bottom: 14px; padding-left: 22px; }
.legal-content li { margin-bottom: 6px; }
.legal-content strong { color: var(--ink); }
.legal-nav-links {
  display: flex; gap: 20px; margin-top: 46px; padding-top: 22px;
  border-top: 1px solid var(--line); font-size: 13.5px;
}
.legal-nav-links a { color: var(--accent); text-decoration: none; }
.legal-nav-links a:hover { text-decoration: underline; }

/* ---------- SUCCESS / ABOUT / CONTACT SHARED CARD PAGES ---------- */
.simple-page {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: linear-gradient(#fff, #eff6ff);
  overflow: hidden;
}
.simple-card {
  max-width: 480px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 44px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.simple-card img { height: 44px; margin: 0 auto 18px; display: block; }
.success-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: rgba(22,163,74,0.1);
  color: var(--accent-2);
  font-size: 26px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.simple-card h1 { font-size: 22px; font-weight: 700; margin-bottom: 10px; }
.simple-card p { color: var(--ink-dim); font-size: 14.5px; margin-bottom: 24px; line-height: 1.6; }
.simple-card .btn { width: 100%; justify-content: center; }
.order-id { font-family: var(--font-mono); font-size: 12px; color: var(--ink-dim); margin-top: 20px; }

/* About / Contact page content */
.content-card {
  max-width: 640px;
  width: 100%;
  background: #fff;
  border-radius: 16px;
  padding: 44px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  text-align: left;
}
.content-card h1 { font-size: 26px; font-weight: 700; margin-bottom: 16px; }
.content-card p { color: var(--ink-dim); font-size: 15px; line-height: 1.7; margin-bottom: 14px; }
.contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.contact-row:first-of-type { border-top: none; margin-top: 10px; }
.contact-row .icon { font-size: 18px; }
.contact-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.contact-row a:hover { text-decoration: underline; }

/* ---------- RESPONSIVE ---------- */
@media (max-height: 850px) {
  .simple-page { padding: 24px 20px; }
  .simple-card { padding: 32px; }
  .simple-card h1 { font-size: 20px; }
  .simple-card p { font-size: 13.5px; margin-bottom: 18px; }
  .content-card { padding: 32px; }
  .content-card h1 { font-size: 22px; }
}

@media (max-width: 640px) {
  footer .container { flex-direction: column; gap: 6px; }
  footer .container > .footer-sep { display: none !important; }
}

@media (max-width: 900px) {
  body { height: auto; min-height: 100vh; overflow: visible; }
  .legal-page { overflow: visible; }
  .legal-wrap { overflow: visible; max-height: none; }
  .hero-wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .card { order: -1; }
}
@media (max-width: 768px) {
  nav { display: none; }
  .container { gap: 15px; }
}
@media (max-height: 760px) {
  .hero { padding: 24px 20px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 15px; margin-bottom: 16px; }
  .card { padding: 22px; }
  .card ul { line-height: 1.7; }
}
