/* =========================================================
   MyCashPower public landing page: modern look (mint on dark)
   Loaded only on the landing page, via {% block head_extra %}.
   Everything is scoped to .landing-page (the <main> class).
   Remove the <link> in landing.html to roll back completely.
   ========================================================= */

.landing-page {
  --d-bg: #0a0e13;
  --d-card: #131922;
  --d-inner: #0f141b;
  --d-chip: #1b2330;
  --d-line: rgba(255, 255, 255, 0.08);
  --d-text: #f3f6f9;
  --d-muted: #9da9ba;
  --d-mint: #4ed6a3;
  --d-mint-soft: rgba(78, 214, 163, 0.12);
  --d-ink: #04241a;
  --d-wide: 1180px;
  max-width: 1400px;
  padding: 0 24px 40px;
  color: var(--d-text);
  overflow-x: clip;
}

html:has(main.landing-page) { scroll-behavior: smooth; }

/* ---------- Page shell ---------- */

body:has(main.landing-page) {
  --bg: #0a0e13;
  --card-bg: #131922;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f3f6f9;
  --muted: #9da9ba;
  --accent: #4ed6a3;
  --accent-dark: #3cc08f;
  background: #0a0e13;
}

body:has(main.landing-page) .topbar {
  background: rgba(10, 14, 19, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 0;
}

body:has(main.landing-page) .lang-switch {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: #131922;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: #f3f6f9;
  font-weight: 700;
}
body:has(main.landing-page) .lang-switch:hover { box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.6); color: #f3f6f9; }

body:has(main.landing-page) .nav-ticker { background: #0f141b; border-bottom: 0; }
body:has(main.landing-page) .site-footer,
body:has(main.landing-page) .site-footer a { color: #9da9ba; }

body:has(main.landing-page) .header-cta-primary,
body:has(main.landing-page) .header-cta-secondary {
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 14px;
  border-radius: 999px;
  font-size: 0.85rem; font-weight: 800; white-space: nowrap;
}
body:has(main.landing-page) a.header-cta-primary,
body:has(main.landing-page) a.header-cta-primary:visited,
body:has(main.landing-page) a.header-cta-primary:hover,
body:has(main.landing-page) a.header-cta-primary:focus {
  background: #4ed6a3; color: #04241a;
}
body:has(main.landing-page) a.header-cta-secondary,
body:has(main.landing-page) a.header-cta-secondary:visited,
body:has(main.landing-page) a.header-cta-secondary:hover,
body:has(main.landing-page) a.header-cta-secondary:focus {
  border: 0; background: #131922; color: #f3f6f9;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* ---------- Buttons (colours survive visited / hover / focus) ---------- */

.landing-page .btn-primary,
.landing-page .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  height: 56px; padding: 0 30px;
  border: 0; border-radius: 999px;
  font-size: 1.02rem; font-weight: 800; line-height: 1; white-space: nowrap; text-decoration: none;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s, background 0.2s;
}
.landing-page a.btn-primary,
.landing-page a.btn-primary:visited,
.landing-page a.btn-primary:hover,
.landing-page a.btn-primary:focus,
.landing-page a.btn-primary:active {
  background: var(--d-mint); color: var(--d-ink);
  box-shadow: 0 12px 32px rgba(78, 214, 163, 0.28);
}
.landing-page a.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); }
.landing-page a.btn-primary:active { transform: scale(0.98); }
.landing-page a.btn-secondary,
.landing-page a.btn-secondary:visited,
.landing-page a.btn-secondary:hover,
.landing-page a.btn-secondary:focus,
.landing-page a.btn-secondary:active {
  background: var(--d-chip); color: var(--d-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.landing-page a.btn-secondary:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.6); }
.landing-page a:focus-visible, .landing-page button:focus-visible, .landing-page input:focus-visible {
  outline: 3px solid var(--d-mint); outline-offset: 3px;
}

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

.landing-container.landing-page .landing-hero {
  position: relative;
  display: flex; align-items: center; gap: 56px;
  width: 100%; max-width: var(--d-wide);
  height: auto; min-height: 0; max-height: none;
  margin: 56px auto 24px; padding: 0 24px;
  border-radius: 0; background: none; overflow: visible;
}

.landing-page .landing-hero-text { flex: 1 1 460px; min-width: 280px; text-align: left; }

.landing-page .landing-hero-text h1 {
  margin: 0 0 20px;
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 800; line-height: 1.04; letter-spacing: -0.035em;
  color: var(--d-text);
  animation: lp-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.landing-page .landing-hero-text h1 span {
  color: var(--d-mint);
  background: linear-gradient(90deg, #4ed6a3, #9af3d3);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-page .landing-hero-text p {
  margin: 0; max-width: 480px;
  color: var(--d-muted); font-size: 1.15rem; line-height: 1.65;
  animation: lp-rise 0.7s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.landing-page .landing-hero-text .landing-cta {
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; margin-top: 32px;
  animation: lp-rise 0.7s 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.landing-page .landing-report-pill,
.landing-page .landing-report-pill:visited {
  margin-top: 20px; padding: 10px 18px;
  border: 0; border-radius: 999px;
  background: rgba(255, 107, 107, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 107, 107, 0.4);
  color: #ff8a8a; font-weight: 800;
}
.landing-page .landing-report-pill:hover { background: rgba(255, 107, 107, 0.18); box-shadow: inset 0 0 0 1px #ff6b6b; color: #ffa0a0; }
.landing-page .landing-report-pill::after { border-color: var(--d-bg); }

@keyframes lp-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.landing-page .landing-hero-visual {
  position: relative; flex: 1 1 320px; min-width: 240px;
  display: flex; justify-content: center; align-items: center;
}
.landing-page .landing-hero-visual::before {
  content: ""; position: absolute; inset: -10% -5%;
  background: radial-gradient(closest-side, rgba(78, 214, 163, 0.22), rgba(78, 214, 163, 0) 70%);
  pointer-events: none;
}
.landing-page .landing-hero-carousel {
  position: relative; width: 100%; max-width: 320px; margin: 0 auto;
  animation: lp-float 7s ease-in-out infinite;
}
@keyframes lp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.landing-page .landing-hero-phone { max-width: 100%; width: 100%; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, 0.55)); }
.landing-page .landing-hero-slide { width: 100%; transition: opacity 0.7s ease, transform 0.7s ease; transform: scale(0.98); }
.landing-page .landing-hero-slide.is-active { transform: none; }

.landing-page .landing-hero-dots { gap: 6px; margin-top: 22px; }
.landing-page .landing-hero-dot {
  position: relative; width: 10px; height: 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: width 0.25s, background 0.2s;
}
.landing-page .landing-hero-dot::before { content: ""; position: absolute; inset: -12px -6px; }
.landing-page .landing-hero-dot.is-active { width: 28px; background: var(--d-mint); transform: none; }
.landing-page .landing-hero-dot:hover { background: rgba(255, 255, 255, 0.4); }
.landing-page .landing-hero-dot.is-active:hover { background: var(--d-mint); }

/* ---------- Feature grid ---------- */

.landing-page .landing-features {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
  width: 100%; max-width: var(--d-wide); margin: 48px auto 0;
  scroll-margin-top: 96px;
}
.landing-page .landing-features > .landing-feature:last-child { grid-column: span 2; }

.landing-page .landing-feature {
  position: relative; min-height: 0; margin: 0; padding: 28px;
  border: 0; border-radius: 28px;
  background: var(--d-card);
  box-shadow: inset 0 0 0 1px var(--d-line);
  transition: transform 0.25s, box-shadow 0.25s;
}
.landing-page .landing-feature:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.35), 0 20px 50px rgba(0, 0, 0, 0.35); }

.landing-page .landing-feature-featured {
  grid-column: 1 / -1;
  padding: 32px;
  background: linear-gradient(135deg, rgba(78, 214, 163, 0.1), rgba(78, 214, 163, 0) 55%), var(--d-card);
  box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.35);
}

.landing-page .feature-badge {
  display: inline-block; margin-bottom: 16px; padding: 5px 14px;
  border-radius: 999px; background: var(--d-mint); color: var(--d-ink);
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.01em;
}

.landing-page .feature-icon {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-bottom: 18px; padding: 14px; box-sizing: border-box;
  border-radius: 20px; background: var(--d-mint-soft); color: var(--d-mint);
}

.landing-page .landing-features h2 {
  margin: 0 0 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; color: var(--d-text);
}
.landing-page .landing-feature .muted { margin: 0; color: var(--d-muted); font-size: 0.97rem; line-height: 1.65; }

.landing-page .landing-feature-featured-inner { display: flex; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
.landing-page .landing-feature-featured-copy { flex: 1 1 340px; min-width: 260px; }
.landing-page .landing-feature-featured-copy .muted { max-width: 520px; }

/* Mini widgets */
.landing-page .landing-feature-mini {
  margin-top: 20px; padding: 16px 18px;
  border: 0; border-radius: 22px;
  background: var(--d-inner); box-shadow: inset 0 0 0 1px var(--d-line);
}
.landing-page .landing-feature-mini-label { display: block; color: var(--d-muted); font-size: 0.82rem; }
.landing-page .landing-feature-mini-value { margin: 6px 0 0; color: var(--d-mint); font-size: 1.4rem; font-weight: 800; }
.landing-page .landing-feature-mini-sub { display: block; margin-top: 6px; color: var(--d-muted); font-size: 0.82rem; }

/* Balance preview */
.landing-page .landing-balance-preview {
  flex: 0 1 340px; min-width: 240px;
  padding: 22px 24px; border: 0; border-radius: 26px;
  background: var(--d-inner); box-shadow: inset 0 0 0 1px var(--d-line);
}
.landing-page .landing-balance-preview-label { margin: 0; color: var(--d-muted); font-size: 0.85rem; }
.landing-page .landing-balance-preview-value { margin: 6px 0 14px; color: var(--d-mint); font-size: 2.1rem; font-weight: 800; letter-spacing: -0.02em; }
.landing-page .landing-balance-preview-chart { height: 72px; color: var(--d-mint); }
.landing-page .landing-balance-preview-chart svg { overflow: visible; filter: drop-shadow(0 6px 10px rgba(78, 214, 163, 0.35)); }
.landing-page .landing-balance-preview-chart polyline { stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 220; stroke-dashoffset: 220; animation: lp-draw 1.6s 0.3s ease-out forwards; }
@keyframes lp-draw { to { stroke-dashoffset: 0; } }

/* Calculator */
.landing-page .landing-calc-featured { flex: 0 1 360px; min-width: 280px; margin-top: 0; padding: 22px 24px; border-radius: 26px; }
.landing-page .landing-feature-mini-lookup .landing-feature-mini-row { display: flex; flex-direction: column; align-items: stretch; gap: 8px; justify-content: flex-start; }
.landing-page .landing-calc-row-offset { margin-top: 14px; }
.landing-page .landing-feature-mini-lookup .landing-feature-mini-label { color: var(--d-muted); font-size: 0.85rem; font-weight: 600; }
.landing-page .landing-feature-mini-lookup input.landing-feature-mini-input {
  width: 100%; height: 50px; padding: 0 20px; box-sizing: border-box;
  border: 0; border-radius: 999px;
  background: var(--d-card); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  color: var(--d-text); font: inherit; font-size: 1.05rem; font-weight: 700; text-align: left;
  transition: box-shadow 0.2s;
}
.landing-page .landing-feature-mini-lookup input.landing-feature-mini-input::placeholder { color: #6e7a8c; font-weight: 500; opacity: 1; }
.landing-page .landing-feature-mini-lookup input.landing-feature-mini-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--d-mint), 0 0 0 5px rgba(78, 214, 163, 0.15); }

.landing-page .landing-calc-featured .field-hint-error { margin-top: 12px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 107, 107, 0.12); color: #ff9a9a; font-size: 0.82rem; font-weight: 700; }
.landing-page .landing-calc-featured .field-hint-error[hidden] { display: none; }

.landing-page .landing-calc-button.btn-primary {
  display: flex; width: 100%; height: 54px; margin-top: 16px; padding: 0 24px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--d-mint); color: var(--d-ink);
  font: inherit; font-size: 1.02rem; font-weight: 800;
  box-shadow: 0 12px 28px rgba(78, 214, 163, 0.25);
}
.landing-page .landing-calc-button.btn-primary:hover { filter: brightness(1.07); background: var(--d-mint); }
.landing-page .landing-calc-button.btn-primary:active { transform: scale(0.98); }

.landing-page .landing-feature-mini-result { margin: 16px 0 0; color: var(--d-mint); font-size: 1.3rem; font-weight: 800; line-height: 1.35; }
.landing-page .landing-calc-breakdown { gap: 0; margin-top: 12px; }
.landing-page .landing-calc-breakdown-row { gap: 12px; padding: 9px 0; border-top: 1px dashed rgba(255, 255, 255, 0.1); color: var(--d-muted); font-size: 0.82rem; }
.landing-page .landing-calc-tip { margin-top: 12px; padding: 12px 16px; border: 0; border-radius: 18px; background: var(--d-mint-soft); color: var(--d-text); font-size: 0.85rem; line-height: 1.5; }

/* Alerts */
.landing-page .landing-feature-mini-alerts {
  margin: 20px 0 0; padding: 0; border: 0; background: none; box-shadow: none;
  flex-direction: row; flex-wrap: wrap; gap: 8px;
}
.landing-page .landing-feature-mini-alerts li {
  padding: 9px 16px; border-radius: 999px; background: var(--d-inner);
  box-shadow: inset 0 0 0 1px var(--d-line); color: var(--d-text); font-size: 0.9rem; font-weight: 700;
}
.landing-page .landing-feature-mini-dot { width: 9px; height: 9px; background: var(--d-mint); box-shadow: 0 0 0 0 rgba(78, 214, 163, 0.5); animation: lp-pulse 2s infinite; }
@keyframes lp-pulse { 0% { box-shadow: 0 0 0 0 rgba(78, 214, 163, 0.5); } 70%, 100% { box-shadow: 0 0 0 8px rgba(78, 214, 163, 0); } }

/* Household */
.landing-page .landing-feature-mini-household { align-items: center; gap: 0; }
.landing-page .landing-feature-mini-avatar {
  width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--d-mint-soft); box-shadow: inset 0 0 0 2px var(--d-mint), 0 0 0 3px var(--d-inner);
  color: var(--d-mint); font-size: 0.9rem; font-weight: 800;
}
.landing-page .landing-feature-mini-avatar + .landing-feature-mini-avatar { margin-left: -10px; }
.landing-page .landing-feature-mini-household .landing-feature-mini-sub { margin: 0 0 0 14px; font-size: 0.9rem; font-weight: 700; }

/* USSD codes */
.landing-page .ussd-step {
  margin-top: 14px; padding: 14px 16px;
  border: 0; border-radius: 22px; background: var(--d-inner); box-shadow: inset 0 0 0 1px var(--d-line);
}
.landing-page .ussd-step:first-of-type { margin-top: 20px; }
.landing-page .ussd-provider { color: var(--d-muted); font-size: 0.92rem; font-weight: 600; }
.landing-page .ussd-code { padding: 8px 14px; border-radius: 999px; background: var(--d-mint-soft); color: var(--d-mint); font-size: 1rem; font-weight: 800; }

/* ---------- Dividers, final call to action, availability ---------- */

.landing-page .landing-divider {
  width: 100%; max-width: var(--d-wide); height: 1px; margin: 48px auto;
  border: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.landing-page .landing-final-cta {
  position: relative; overflow: hidden;
  width: 100%; max-width: var(--d-wide); margin: 0 auto; padding: 56px 28px; box-sizing: border-box;
  border-radius: 36px; text-align: center;
  background: radial-gradient(60% 120% at 50% 0%, rgba(78, 214, 163, 0.18), rgba(78, 214, 163, 0) 70%), var(--d-card);
  box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.3);
}
.landing-page .landing-final-cta h2 { margin: 0 0 10px; font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; letter-spacing: -0.02em; }
.landing-page .landing-final-cta p { margin: 0 0 26px; color: var(--d-muted); font-size: 1.05rem; }
.landing-page .landing-final-cta .btn-primary { padding: 0 36px; }

.landing-page .landing-availability {
  display: flex; align-items: center; gap: 18px;
  width: 100%; max-width: 760px; margin: 0 auto; padding: 22px 24px; box-sizing: border-box;
  border: 0; border-radius: 28px;
  background: linear-gradient(135deg, rgba(78, 214, 163, 0.08), rgba(78, 214, 163, 0.02));
  box-shadow: inset 0 0 0 1px rgba(78, 214, 163, 0.22);
}
.landing-page .landing-availability-icon {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 20px;
  background: var(--d-mint-soft); color: var(--d-mint);
}
.landing-page .landing-availability-icon svg { width: 26px; height: 26px; }
.landing-page .landing-availability h2 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; color: var(--d-text); }
.landing-page .landing-availability p { margin: 0; color: var(--d-muted); font-size: 0.92rem; line-height: 1.6; }

/* ---------- Scroll-in animation (only where the browser supports it) ---------- */

@supports (animation-timeline: view()) {
  .landing-page .landing-feature,
  .landing-page .landing-final-cta {
    animation: lp-rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page *, .landing-page *::before { animation: none !important; transition: none !important; }
  .landing-page .landing-balance-preview-chart polyline { stroke-dashoffset: 0; }
  html:has(main.landing-page) { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .landing-page .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .landing-container.landing-page .landing-hero {
    flex-direction: column; align-items: stretch; gap: 36px; margin-top: 28px; padding: 0 4px; text-align: center;
  }
  .landing-page .landing-hero-text { flex: 0 0 auto; min-width: 0; text-align: center; }
  .landing-page .landing-hero-text p { margin-left: auto; margin-right: auto; }
  .landing-page .landing-hero-text .landing-cta { justify-content: center; }
  .landing-page .landing-report-pill { margin-left: auto; margin-right: auto; }
  .landing-page .landing-hero-visual { flex: 0 0 auto; min-width: 0; }
  .landing-page .landing-hero-carousel { max-width: 260px; }
}

@media (max-width: 800px) {
  .landing-page .landing-feature-featured-inner { flex-direction: column; align-items: stretch; gap: 24px; }
  .landing-page .landing-feature-featured-copy { flex: 0 0 auto; min-width: 0; }
  .landing-page .landing-balance-preview,
  .landing-page .landing-calc-featured { flex: 0 0 auto; width: 100%; min-width: 0; box-sizing: border-box; }
}

@media (max-width: 700px) {
  .landing-page { padding: 0 16px 24px; }
  .landing-page .landing-features { grid-template-columns: 1fr; gap: 16px; margin-top: 36px; }
  .landing-page .landing-features > .landing-feature:last-child { grid-column: auto; }
  .landing-page .landing-feature { padding: 24px 20px; border-radius: 26px; }
  .landing-page .landing-feature-featured { padding: 26px 20px; }
  .landing-page .landing-divider { margin: 36px auto; }
  .landing-page .landing-final-cta { padding: 40px 20px; border-radius: 30px; }
  .landing-page .landing-availability { gap: 14px; padding: 18px 18px; border-radius: 26px; }
  .landing-page .landing-availability-icon { width: 46px; height: 46px; border-radius: 16px; }
  .landing-page .landing-availability-icon svg { width: 22px; height: 22px; }
}

@media (max-width: 500px) {
  .landing-page .landing-hero-text .landing-cta { flex-direction: column; align-items: stretch; width: 100%; }
  .landing-page .landing-hero-text .landing-cta .btn-primary,
  .landing-page .landing-hero-text .landing-cta .btn-secondary { width: 100%; white-space: normal; }
  .landing-page .landing-final-cta .btn-primary { width: 100%; }
  .landing-page .landing-availability { align-items: flex-start; }
}
