/* =========================================================================
 * BillSense web — shared styles
 * Pages: index.html (cinematic landing), terms.html, privacy.html,
 *        delete-account.html (all use the legal-doc styles via main/h1/h2)
 * Cinematic styles are scoped to body.cinematic so legal docs stay readable.
 * ========================================================================= */

:root {
  --bg: #0B0F12;
  --bg-soft: #11161B;
  --surface: #14181D;
  --surface-2: #1A1F25;
  --border: #2A2F36;
  --border-soft: #1E2329;
  --text: #FFFFFF;
  --text-muted: #A8B2BD;
  --text-dim: #6B7480;
  --brand: #22C39A;
  --brand-deep: #14A07A;
  --brand-glow: rgba(34, 195, 154, 0.45);
  --amber: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.35);
  --blue-glow: rgba(56, 132, 255, 0.35);
  --danger: #EF4444;
  --brand-ink: #0B0F12;
  --max: 1200px;
  --max-prose: 720px;
  --radius: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Legal-document layout (terms.html / privacy.html / delete-account) ===== */

body:not(.cinematic) header {
  padding: 32px 24px 0;
  max-width: var(--max-prose);
  margin: 0 auto;
}
body:not(.cinematic) main {
  padding: 32px 24px 64px;
  max-width: var(--max-prose);
  margin: 0 auto;
}
body:not(.cinematic) h1 {
  font-size: clamp(28px, 5vw, 42px);
  margin: 16px 0 8px;
  line-height: 1.15;
}
body:not(.cinematic) h2 {
  font-size: 22px;
  margin: 32px 0 8px;
  color: var(--text);
}
body:not(.cinematic) p,
body:not(.cinematic) li {
  color: var(--text-muted);
}
body:not(.cinematic) .lead {
  font-size: 18px;
  color: var(--text);
}
body:not(.cinematic) .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 24px;
}
body:not(.cinematic) .muted {
  color: var(--text-muted);
  font-size: 13px;
}
body:not(.cinematic) footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px;
  max-width: var(--max-prose);
  margin-left: auto;
  margin-right: auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
body:not(.cinematic) footer a { color: var(--text-muted); }
body:not(.cinematic) footer a:hover { color: var(--text); }
body:not(.cinematic) ul { padding-left: 20px; }
body:not(.cinematic) li { margin-bottom: 6px; }
.brand {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 14px;
  color: var(--brand);
  text-transform: uppercase;
}
.cta {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 12px;
  margin-top: 24px;
}
.cta:hover { text-decoration: none; opacity: 0.9; }
.cta.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  margin-left: 8px;
}

/* ===== Cinematic landing (body.cinematic) ===== */

body.cinematic {
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.orb {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-green { top: -120px; left: -160px; background: var(--brand-glow); }
.orb-amber { top: 35%; right: -180px; background: var(--amber-glow); animation-delay: -6s; }
.orb-blue  { bottom: -200px; left: 30%; background: var(--blue-glow); animation-delay: -12s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, -40px) scale(1.15); }
}

.cinema-header {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(20px, 4vw, 48px);
  max-width: var(--max);
  margin: 0 auto;
}
.header-nav {
  display: flex;
  gap: 24px;
  align-items: center;
}
.header-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.header-nav a:hover { color: var(--text); text-decoration: none; }
.cta-small {
  background: var(--brand);
  color: var(--brand-ink) !important;
  padding: 8px 16px !important;
  border-radius: 999px;
  margin-top: 0 !important;
  font-size: 13px;
}

body.cinematic main {
  position: relative;
  z-index: 5;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
}

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

.hero {
  position: relative;
  padding: clamp(40px, 8vw, 96px) 0 clamp(60px, 8vw, 120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}

.eyebrow-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(34, 195, 154, 0.06);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero-headline {
  font-size: clamp(40px, 7vw, 78px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 900;
  margin: 0 0 24px;
  color: var(--text);
}
.grad-text {
  background: linear-gradient(120deg, var(--brand) 30%, #6FE3C4 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 36px;
  max-width: 540px;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 26px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  border: 1px solid transparent;
  margin-top: 0;
}
.cta:hover { text-decoration: none; transform: translateY(-2px); }
.cta-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 12px 36px var(--brand-glow);
}
.cta-primary:hover { box-shadow: 0 18px 50px var(--brand-glow); }
.cta-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
}
.cta-ghost:hover { background: rgba(255, 255, 255, 0.08); }
.cta-arrow { transition: transform 0.2s ease; }
.cta:hover .cta-arrow { transform: translateX(4px); }
.cta-big { padding: 20px 36px; font-size: 17px; }

.hero-microcopy {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-dim);
}

/* ----- Hero stage (3D bill + phone) ----- */

.hero-stage {
  position: relative;
  height: clamp(360px, 48vw, 540px);
  perspective: 1400px;
}
.floating-bill,
.phone-frame {
  position: absolute;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
.floating-bill {
  top: 6%;
  left: 0;
  width: 64%;
  background: #F4F1E8;
  color: #1F2937;
  border-radius: 12px;
  padding: 22px 24px;
  border: 1px solid #D9D2BD;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6),
              0 8px 24px rgba(0,0,0,0.4);
  transform: rotateY(-12deg) rotateX(8deg) rotateZ(-3deg);
}
.bill-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  font-weight: 600;
}
.bill-row-head {
  border-bottom: 2px solid #1F2937;
  padding-bottom: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 1.5px;
  font-weight: 800;
  text-transform: uppercase;
}
.bill-row-head .muted { color: #6B7280; font-weight: 600; }
.bill-waste {
  background: #FEF3C7;
  color: #DC2626;
  padding: 2px 8px;
  border-radius: 4px;
}
.bill-divider {
  height: 1px;
  background: #1F2937;
  margin-top: 6px;
}
.bill-row-total {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-top: 2px;
}
.bill-callout {
  margin-top: 14px;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  text-align: center;
  align-self: flex-start;
  display: inline-block;
}

.phone-frame {
  bottom: 0;
  right: 0;
  width: 56%;
  height: 78%;
  background: linear-gradient(160deg, #1A1F25, #0B0F12);
  border-radius: 36px;
  border: 2px solid #2A2F36;
  padding: 18px;
  box-shadow: 0 36px 100px rgba(0,0,0,0.7),
              0 0 0 6px rgba(34, 195, 154, 0.04),
              0 12px 30px rgba(34, 195, 154, 0.15);
  transform: rotateY(10deg) rotateX(-4deg) rotateZ(2deg);
}
.phone-screen {
  height: 100%;
  background: linear-gradient(180deg, #11161B, #0B0F12);
  border-radius: 24px;
  padding: 22px 18px;
  border: 1px solid #2A2F36;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.phone-eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  font-weight: 800;
  color: var(--brand);
}
.phone-headline {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}
.phone-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
}
.phone-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}
.phone-stat-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--brand);
}
.phone-stat-lbl {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .hero-stage { height: 420px; }
}

/* ----- Solutions grid ----- */

.solutions {
  padding: clamp(60px, 8vw, 120px) 0;
}
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
  text-align: center;
  color: var(--text);
}
.section-sub {
  font-size: 17px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 56px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .grid { grid-template-columns: 1fr; } }

.solution-card {
  position: relative;
  padding: 28px 24px;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}
.solution-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(34,195,154,0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.solution-card:hover {
  transform: translateY(-6px) rotateX(2deg);
  border-color: var(--brand);
  box-shadow: 0 20px 50px rgba(0,0,0,0.4),
              0 0 0 1px var(--brand-glow);
}
.solution-card:hover::before { opacity: 1; }
.solution-icon {
  font-size: 32px;
  margin-bottom: 18px;
  filter: drop-shadow(0 4px 12px var(--brand-glow));
}
.solution-card h3 {
  font-size: 19px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--text);
}
.solution-card p {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

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

.pricing { padding: clamp(60px, 8vw, 120px) 0; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  max-width: 760px;
  margin: 0 auto;
}
@media (max-width: 720px) { .pricing-grid { grid-template-columns: 1fr; } }

.price-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  position: relative;
}
.price-card .cta { width: 100%; justify-content: center; margin-top: 18px; }
.price-annual {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand-glow), 0 24px 60px rgba(0,0,0,0.4);
}
.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.price-name {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  font-weight: 800;
  text-transform: uppercase;
}
.price-amount {
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 900;
  margin: 8px 0 4px;
  color: var(--text);
}
.price-unit { color: var(--text-muted); font-weight: 600; font-size: 0.5em; }
.price-equiv { color: var(--brand); font-weight: 700; font-size: 14px; min-height: 22px; }
.price-features {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.price-features li {
  position: relative;
  padding-left: 26px;
  color: var(--text-muted);
  font-size: 14.5px;
}
.price-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: 900;
}
.pricing-foot {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

/* ----- Closer ----- */

.closer {
  text-align: center;
  padding: clamp(80px, 10vw, 160px) 0 clamp(80px, 10vw, 140px);
}
.closer-line {
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.05;
  color: var(--text);
}
.closer-line.accent { color: var(--brand); margin-bottom: 36px; }

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

.cinema-footer {
  border-top: 1px solid var(--border-soft);
  padding: 32px clamp(20px, 4vw, 48px);
  max-width: var(--max);
  margin: 0 auto;
}
.footer-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-nav a { color: var(--text-muted); }
.footer-nav a:hover { color: var(--text); text-decoration: none; }

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .orb { animation: none; }
  .floating-bill, .phone-frame { transition: none; }
}
