/* ==========================================================================
   MonthBox website - shared styles for every page
   Brand colors come from the app icon (blue -> cyan) and match the iOS app.
   ========================================================================== */

:root {
  --brand-blue: #2563eb;
  --brand-cyan: #0891b2;
  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  --premium-gradient: linear-gradient(90deg, #f97316 0%, #ec4899 100%);
  --green: #16a34a;
  --orange: #ea580c;
  --red: #dc2626;

  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --link: #1d4ed8;
  --shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.18);

  --radius: 20px;
  --max-width: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #111a2e;
    --surface-2: #18233b;
    --text: #e6edf7;
    --muted: #a3b3c9;
    --border: #243250;
    --link: #7fb0ff;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.5);
  }
}

/* --- Base ---------------------------------------------------------------- */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--link); text-underline-offset: 3px; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--brand-cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.container {
  /* 16px gutters on phones, centered max width on larger screens */
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
}

.narrow { width: min(100% - 32px, 780px); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}
.skip-link:focus { left: 16px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- Header & navigation ------------------------------------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { width: 34px; height: 34px; }

.site-nav { display: flex; align-items: center; gap: 2px; }

.site-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  background: var(--surface-2);
}

@media (max-width: 600px) {
  .site-nav .nav-optional { display: none; }
  .site-nav a { padding: 8px 10px; }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-store {
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow);
}

.btn-store small { display: block; font-size: 0.72rem; font-weight: 500; opacity: 0.8; }
.btn-store span { text-align: left; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-light {
  background: #fff;
  color: #0f172a;
}

/* Download buttons without an App Store link yet ("coming soon") */
.btn[aria-disabled="true"] { cursor: default; opacity: 0.85; }
.btn[aria-disabled="true"]:hover { transform: none; }

/* --- Hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 72px 0 88px;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(8, 145, 178, 0.18), transparent 60%),
    radial-gradient(700px 420px at -10% 20%, rgba(37, 99, 235, 0.16), transparent 60%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.eyebrow img { width: 22px; height: 22px; }

.gradient-text {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  max-width: 34em;
  font-size: 1.2rem;
  color: var(--muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 22px;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.trust-list li { display: inline-flex; align-items: center; gap: 6px; }
.trust-list svg { width: 18px; height: 18px; color: var(--green); flex-shrink: 0; }

@media (max-width: 900px) {
  .hero { padding: 48px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { justify-self: center; }
}

/* --- Phone mockup (pure CSS, mirrors the real dashboard) ------------------ */

.phone {
  position: relative;
  width: 300px;
  max-width: 100%;
  padding: 12px;
  border-radius: 48px;
  background: #0b1020;
  box-shadow: var(--shadow-lg), inset 0 0 0 2px #2a3350;
  transform: rotate(2deg);
}

/* On the narrowest phones the tilted mockup would poke past the screen edge */
@media (max-width: 360px) {
  .phone { transform: none; }
}

.phone-screen {
  overflow: hidden;
  border-radius: 38px;
  background: #f2f4f8;
  color: #0f172a;
  padding: 14px 14px 18px;
  font-size: 13px;
  line-height: 1.35;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 10px 10px;
  font-weight: 600;
  font-size: 12px;
}

.phone-island {
  width: 86px;
  height: 22px;
  border-radius: 999px;
  background: #0b1020;
}

.phone-title { margin: 2px 4px 10px; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

.mock-hero {
  padding: 14px;
  border-radius: 20px;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.mock-row { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; opacity: 0.95; }

.mock-badge {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-weight: 700;
  font-size: 10.5px;
}

.mock-amount { margin: 4px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }

.mock-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.mock-bar span { display: block; height: 100%; border-radius: inherit; background: #fff; }

.mock-caption { margin: 6px 0 10px; font-size: 10.5px; opacity: 0.92; }

.mock-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mock-stats div { padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, 0.16); }
.mock-stats small { display: block; font-size: 9.5px; opacity: 0.85; }
.mock-stats b { font-size: 12px; }

.mock-card { margin-top: 10px; padding: 12px; border-radius: 18px; background: #fff; }
.mock-card-title { margin-bottom: 8px; font-weight: 700; font-size: 13px; }

.mock-bill { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.mock-bill + .mock-bill { border-top: 1px solid #eef1f6; }
.mock-bill div { flex: 1; min-width: 0; }
.mock-bill b { display: block; font-size: 12px; }
.mock-bill small { font-size: 10.5px; color: #64748b; }
.mock-bill small.warn { color: var(--orange); font-weight: 600; }
.mock-amt { font-weight: 700; font-size: 12px; }

.mock-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 16%, #fff);
  color: var(--c);
}
.mock-icon svg { width: 15px; height: 15px; }

.mock-pay {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

/* --- Sections ------------------------------------------------------------ */

.section { padding: 88px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 680px; margin: 0 auto 48px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.1rem; }

.kicker {
  display: block;
  margin-bottom: 10px;
  color: var(--brand-blue);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-color-scheme: dark) {
  .kicker { color: #7fb0ff; }
}

@media (max-width: 700px) {
  .section { padding: 64px 0; }
}

/* --- Feature cards ------------------------------------------------------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }

.card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.section-alt .card { background: var(--bg); box-shadow: none; }

.card p { margin: 0; color: var(--muted); }

.icon-tile {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}

.icon-tile svg { width: 24px; height: 24px; }

.premium-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--premium-gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

/* --- Steps --------------------------------------------------------------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li { position: relative; padding-top: 64px; }

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  top: 28px;
  left: 28px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  font-weight: 800;
}

.steps li.card { padding-top: 84px; }

@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* --- Split section (widget showcase) ------------------------------------ */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 56px;
}

.split p { color: var(--muted); }

.check-list { margin: 20px 0 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 10px; margin-bottom: 10px; }
.check-list svg { width: 22px; height: 22px; color: var(--green); flex-shrink: 0; margin-top: 2px; }

.widgets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.widget {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 170px;
  height: 170px;
  padding: 16px;
  border-radius: 28px;
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.widget.medium { width: 360px; height: 170px; flex-direction: row; gap: 16px; }
.widget-label { font-size: 12px; font-weight: 600; opacity: 0.9; }
.widget-amount { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.widget small { font-size: 12px; opacity: 0.92; }
.widget .mock-bar { margin: 8px 0; }
.widget-col { display: flex; flex: 1; flex-direction: column; justify-content: space-between; }
.widget-stat { font-size: 12px; opacity: 0.9; }
.widget-stat b { display: block; font-size: 15px; opacity: 1; }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 420px) {
  .widget.medium { width: 100%; }
}

/* --- Privacy band -------------------------------------------------------- */

.privacy-band {
  position: relative;
  overflow: hidden;
  padding: 56px;
  border-radius: 28px;
  background: #0f172a;
  color: #e6edf7;
}

.privacy-band::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.45), transparent 70%);
}

/* In dark mode the band is close to the page color - outline it */
@media (prefers-color-scheme: dark) {
  .privacy-band { border: 1px solid var(--border); background: #0f1a33; }
}

.privacy-band h2 { color: #fff; }
.privacy-band p { color: #b8c6da; max-width: 40em; }

.privacy-points {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.privacy-points li {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.privacy-points b { display: block; color: #fff; margin-bottom: 4px; }
.privacy-points span { color: #b8c6da; font-size: 0.95rem; }

@media (max-width: 900px) { .privacy-points { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .privacy-band { padding: 32px 22px; }
  .privacy-points { grid-template-columns: 1fr; }
}

/* --- Pricing ------------------------------------------------------------- */

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 920px;
  margin: 0 auto;
}

.price-card { display: flex; flex-direction: column; }
.price-card h3 { font-size: 1.4rem; }
.price-card .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 2px; }
.price-card .price small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.price-card ul { flex: 1; margin: 22px 0 0; padding: 0; list-style: none; }
.price-card li { display: flex; gap: 10px; margin-bottom: 10px; color: var(--text); }
.price-card li svg { width: 20px; height: 20px; color: var(--green); flex-shrink: 0; margin-top: 3px; }

.price-card.featured {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--premium-gradient) border-box;
}

.section-alt .price-card.featured {
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--premium-gradient) border-box;
}

.price-options { display: grid; gap: 8px; margin-top: 18px; }

.price-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 0.95rem;
}

.price-option b { font-size: 1.05rem; }

.save-badge {
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.fine-print { margin-top: 18px; color: var(--muted); font-size: 0.85rem; text-align: center; }

@media (max-width: 760px) { .pricing-grid { grid-template-columns: 1fr; } }

/* --- FAQ (details/summary accordion, works without JavaScript) ----------- */

.faq-list { display: grid; gap: 12px; }

.faq-list details {
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.section-alt .faq-list details { background: var(--bg); }

.faq-list summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list details > div { padding: 0 22px 20px; color: var(--muted); }
.faq-list details > div p:last-child { margin-bottom: 0; }

.faq-group { margin-top: 44px; }
.faq-group:first-of-type { margin-top: 0; }
.faq-group h2 { font-size: 1.3rem; margin-bottom: 16px; }

/* --- Final call to action -------------------------------------------------- */

.cta-band {
  padding: 64px 32px;
  border-radius: 28px;
  background: var(--brand-gradient);
  color: #fff;
  text-align: center;
  box-shadow: 0 24px 48px rgba(37, 99, 235, 0.3);
}

.cta-band h2 { color: #fff; }
.cta-band p { max-width: 36em; margin-inline: auto; color: rgba(255, 255, 255, 0.92); font-size: 1.1rem; }
.cta-band .cta-row { justify-content: center; margin-bottom: 0; }
.cta-band .btn-store { background: #fff; color: #0f172a; }

/* --- Page header (sub pages) --------------------------------------------- */

.page-header {
  padding: 64px 0 40px;
  text-align: center;
  background:
    radial-gradient(700px 300px at 50% -30%, rgba(37, 99, 235, 0.16), transparent 70%);
}

.page-header p { color: var(--muted); font-size: 1.15rem; margin: 0; }

/* --- Long-form content (privacy, terms) ---------------------------------- */

.prose {
  margin-bottom: 72px;
  padding: 40px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}

.prose h2 { font-size: 1.35rem; margin-top: 1.8em; }
.prose h2:first-of-type { margin-top: 0.6em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: var(--muted); }
.prose strong { color: var(--text); }
.prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }

.last-updated { color: var(--muted); font-size: 0.9rem; }

.callout {
  margin: 24px 0;
  padding: 18px 22px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--brand-blue) 10%, transparent);
  border-left: 4px solid var(--brand-blue);
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 560px) { .prose { padding: 24px 20px; } }

/* --- Support page ------------------------------------------------------------ */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.contact-grid .card h2 { font-size: 1.2rem; }
.contact-grid .card a { font-weight: 600; word-break: break-word; }

.contact-grid.two-col { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 860px) {
  .contact-grid,
  .contact-grid.two-col { grid-template-columns: 1fr; }
}

.support-list { padding-left: 1.2em; color: var(--muted); }
.support-list li { margin-bottom: 8px; }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
