/* Marketing site for scriptesia.com. Deliberately shares the app's palette so
   the handoff from landing page to product feels like one product. */
:root {
  --bg: #0a0c12;
  --panel: #141824;
  --panel2: #1c2333;
  --text: #eef2f8;
  --muted: #8b94a7;
  --accent: #6366f1;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --radius: 14px;
  --edge: #242c3d;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; }
img { max-width: 100%; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 720px; }

.logo {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-decoration: none;
}
.logo-link { display: inline-block; line-height: 0; }
.logo-link img { display: block; height: 30px; width: auto; }
footer .logo-link img { height: 26px; }

/* ---------- nav ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.nav-links { display: flex; align-items: center; gap: 24px; font-size: 15px; flex-shrink: 0; }
.nav-links a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.nav-links a:hover { color: var(--text); }

/* On a phone the wordmark and three links can't share a row — shrink the
   logo and drop the section links, leaving the mark and Sign in. */
@media (max-width: 560px) {
  .nav { padding: 16px 0; gap: 12px; }
  .logo-link img { height: 24px; }
  .nav-links { gap: 14px; font-size: 14px; }
  .nav-links a:not(.btn) { display: none; }
}

.btn {
  display: inline-block;
  background: var(--panel2);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 13px 22px;
  font-size: 16px; font-weight: 600;
  text-decoration: none;
  transition: filter 0.15s ease;
}
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: var(--grad); border: none; }
.btn.sm { padding: 10px 18px; font-size: 15px; }
.btn.lg { padding: 17px 32px; font-size: 18px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 64px; text-align: center; }
h1 {
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 22px;
}
.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede { font-size: clamp(17px, 2.2vw, 21px); color: var(--muted); max-width: 640px; margin: 0 auto 34px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.under-cta { margin-top: 16px; font-size: 14px; color: var(--muted); }

/* ---------- sections ---------- */
section { padding: 68px 0; border-top: 1px solid var(--edge); }
h2 {
  font-size: clamp(27px, 3.6vw, 38px);
  letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 14px; font-weight: 800;
}
.section-lede { color: var(--muted); font-size: 17px; max-width: 620px; margin-bottom: 40px; }
.center { text-align: center; }
.center .section-lede { margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { font-size: 18px; margin-bottom: 9px; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 15px; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grad); font-size: 15px; font-weight: 700;
  margin-bottom: 14px;
}

/* ---------- pricing ---------- */
.price-card {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: 18px;
  padding: 38px;
  max-width: 460px; margin: 0 auto;
  text-align: center;
}
.price { font-size: 56px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.price span { font-size: 18px; font-weight: 600; color: var(--muted); }
.price-sub { color: var(--muted); margin: 10px 0 26px; }
.price-list { list-style: none; text-align: left; margin: 0 0 28px; display: flex; flex-direction: column; gap: 12px; }
.price-list li { display: flex; gap: 11px; font-size: 15px; align-items: flex-start; }
.price-list .tick { color: var(--accent); font-weight: 700; flex-shrink: 0; }
.topups { margin-top: 26px; color: var(--muted); font-size: 14px; }

/* ---------- faq ---------- */
.faq { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.faq details {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.faq summary { font-weight: 600; cursor: pointer; font-size: 16px; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ' +'; color: var(--muted); }
.faq details[open] summary::after { content: ' –'; }
.faq p { color: var(--muted); margin-top: 12px; font-size: 15px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--edge); padding: 40px 0 56px; color: var(--muted); font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: center; }
.foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--text); }

/* ---------- checkout ---------- */
.checkout-page { background: radial-gradient(1100px 600px at 50% -10%, #171a2b 0%, var(--bg) 60%); min-height: 100vh; }
.co-wrap { max-width: 1000px; margin: 0 auto; padding: 34px 24px 72px; }
.co-wrap.narrow-wrap { max-width: 640px; }
.co-logo { display: block; width: 190px; margin: 0 auto 34px; }
.co-logo img { display: block; width: 100%; }

.co-grid { display: grid; gap: 26px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .co-grid { grid-template-columns: 1fr 1.1fr; align-items: start; } }

.co-summary {
  background: var(--panel); border: 1px solid var(--edge);
  border-radius: 18px; padding: 26px;
}
.co-summary h2 { font-size: 17px; margin-bottom: 18px; }
.co-line { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; padding-bottom: 16px; border-bottom: 1px solid var(--edge); }
.co-line strong { display: block; font-size: 16px; }
.co-line span { color: var(--muted); font-size: 14px; }
.co-amt { font-size: 24px; font-weight: 800; white-space: nowrap; }
.co-amt em { font-size: 14px; font-weight: 600; color: var(--muted); font-style: normal; }
.co-total { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; font-size: 17px; }
.co-total strong { font-size: 24px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.co-note { color: var(--muted); font-size: 14px; line-height: 1.55; padding-top: 4px; border-top: 1px solid var(--edge); }
.co-perks { list-style: none; margin-top: 20px; display: flex; flex-direction: column; gap: 9px; }
.co-perks li { font-size: 14px; color: #c3cbdb; padding-left: 22px; position: relative; }
.co-perks li::before { content: '✓'; position: absolute; left: 0; color: var(--accent); font-weight: 700; }

.co-form { background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 28px; }
.co-form h1 { font-size: 24px; letter-spacing: -0.02em; margin-bottom: 22px; }
.co-field { display: block; margin-bottom: 18px; }
/* First + last side by side on desktop, stacked once there isn't room. */
.co-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 460px) { .co-row { grid-template-columns: 1fr; gap: 0; } }
.co-field > span { display: block; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.co-field input {
  width: 100%; background: var(--bg); border: 1px solid var(--edge);
  border-radius: 12px; padding: 14px; font-size: 16px; color: var(--text);
  outline: none; font-family: inherit;
}
.co-field input:focus { border-color: var(--accent); }
.co-hint { display: block; margin-top: 7px; font-size: 12px; color: var(--muted); font-style: normal; }
.co-card { background: var(--bg); border: 1px solid var(--edge); border-radius: 12px; padding: 15px 14px; }
.co-card.StripeElement--focus { border-color: var(--accent); }

.co-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.4); color: #fca5a5; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.co-error[hidden] { display: none; }

.co-submit {
  width: 100%; background: var(--grad); border: none; border-radius: 12px;
  padding: 17px; font-size: 17px; font-weight: 700; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit;
}
.co-submit:disabled { opacity: 0.65; cursor: default; }
.co-spinner { width: 17px; height: 17px; border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: cospin 0.7s linear infinite; }
.co-spinner[hidden] { display: none; }
@keyframes cospin { to { transform: rotate(360deg); } }

.co-fine { margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.co-fine a { color: var(--accent); }
.co-secure { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

.co-done { background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; padding: 40px 30px; text-align: center; }
.co-check { width: 56px; height: 56px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 27px; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.co-done h1 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 12px; }
.co-done-lede { color: var(--muted); font-size: 16px; line-height: 1.6; margin-bottom: 26px; }
.co-steps { text-align: left; max-width: 400px; margin: 0 auto 28px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: #c3cbdb; font-size: 15px; }

/* ---------- legal modal ----------
   Legal text opens in a modal rather than navigating away — the dedicated
   pages still exist for direct links and App Store submission, and the modal
   pulls its content from them so there is only ever one copy of the text. */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  background: var(--bg);
  border: 1px solid var(--edge);
  border-radius: 16px;
  width: min(760px, 100%);
  max-height: min(85vh, 900px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--edge);
  flex-shrink: 0;
}
.modal-head h2 { font-size: 19px; margin: 0; }
.modal-close {
  background: var(--panel2); border: 1px solid var(--edge); color: var(--text);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 17px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.modal-body { overflow-y: auto; padding: 4px 24px 24px; -webkit-overflow-scrolling: touch; }
.modal-body h1 { display: none; }
.modal-body .updated { margin-bottom: 24px; }
.modal-foot {
  padding: 12px 20px; border-top: 1px solid var(--edge);
  flex-shrink: 0; font-size: 13px; color: var(--muted);
}
.modal-foot a { color: var(--accent); }

/* ---------- legal pages ---------- */
.legal { padding: 48px 0 72px; }
.legal h1 { font-size: clamp(30px, 4vw, 42px); margin-bottom: 8px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.legal h2 { font-size: 21px; margin: 34px 0 10px; }
.legal p, .legal li { color: #c3cbdb; font-size: 16px; margin-bottom: 12px; }
.legal ul { padding-left: 22px; }
.legal a { color: var(--accent); }
.legal .callout {
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 22px 0;
}

/* ---------- checkout promo code ---------- */
.co-promo { margin: 10px 0 4px; }
.co-promo-link { background: none; border: none; color: #8b5cf6; font-size: 14px; cursor: pointer; padding: 0; }
.co-promo-row { display: flex; gap: 8px; margin-top: 6px; }
.co-promo-row input { flex: 1; background: #141824; border: 1px solid #2a3242; border-radius: 10px; padding: 10px 12px; color: #eef2f8; font-size: 15px; text-transform: uppercase; }
.co-promo-btn { background: #232a3a; border: 1px solid #2a3242; border-radius: 10px; padding: 10px 16px; color: #eef2f8; font-weight: 600; cursor: pointer; }
.co-promo-msg { font-size: 14px; margin-top: 8px; }
.co-promo-msg.ok { color: #34d399; }
.co-promo-msg.bad { color: #ef4444; }

/* Post-checkout App Store pointer — the web sign-in stays the primary CTA. */
.co-appstore { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--edge); }
.co-appstore p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.co-appstore img { height: 48px; }
