/*
  iFundsCoupon.com — Design System
  Single source of truth for typography, color, and layout across every page.
*/

:root {
  --brand-900: #120d2e;
  --brand-800: #1d1650;
  --brand-700: #2c2277;
  --brand-600: #4338ca;
  --brand-500: #6d5ef0;
  --brand-100: #edeafd;

  --accent-600: #d97706;
  --accent-500: #f59e0b;
  --accent-100: #fef3e0;

  --success-600: #059669;
  --success-100: #e3f9ef;

  --ink-900: #10101f;
  --ink-700: #35354d;
  --ink-500: #68697f;
  --ink-300: #d8d8e6;
  --ink-100: #f0f0f8;

  --bg: #f6f6fc;
  --surface: #ffffff;
  --border: #e6e6f2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(16, 12, 40, 0.06);
  --shadow-md: 0 10px 24px rgba(29, 22, 80, 0.10);
  --shadow-lg: 0 24px 50px rgba(18, 13, 46, 0.22);

  --container: 1120px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  max-width: 100%;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink-700);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4, h5 {
  color: var(--ink-900);
  font-weight: 750;
  line-height: 1.25;
  margin: 0 0 .6em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.2rem; }
h5 { font-size: 1.02rem; color: var(--brand-700); }

p { margin: 0 0 1em; }
.lead { font-size: 1.1rem; color: var(--ink-500); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-700);
  color: #fff;
  padding: 10px 16px;
  z-index: 2000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.navbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink-900);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--ink-900); }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
  flex: none;
}
.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink-900);
  transition: transform .2s ease, opacity .2s ease, top .2s ease;
}
.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0; padding: 0;
  font-weight: 600;
  font-size: .93rem;
}
.nav-links a { color: var(--ink-700); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--brand-700); text-decoration: none; }
.nav-cta {
  background: var(--accent-500);
  color: #fff !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--accent-600); color: #fff !important; }

@media (max-width: 860px) {
  /* Compact hamburger menu on mobile: hidden by default, opens as a full-width dropdown */
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 100%);
    overflow-y: auto;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 20px 18px;
    display: none;
    gap: 4px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.is-open { display: flex; }
  .nav-links li { border-bottom: 1px solid var(--ink-100); }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    padding: 14px 8px;
    font-size: 1rem;
    border-radius: 8px;
  }
  .nav-links a:hover, .nav-links a[aria-current="page"] {
    background: var(--brand-100);
    color: var(--brand-700);
  }
  .nav-links a.nav-cta,
  .nav-links a.nav-cta:hover {
    display: block;
    margin-top: 8px;
    padding: 13px 16px;
    text-align: center;
    background: var(--accent-500);
    color: #fff !important;
  }
}

/* Prevent background scroll while the mobile menu is open */
body.nav-open { overflow: hidden; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(55% 80% at 88% 0%, rgba(245, 158, 11, 0.28), transparent 60%),
    radial-gradient(50% 70% at 8% 100%, rgba(109, 94, 240, 0.35), transparent 60%),
    linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #fff;
  padding: 56px 0 46px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  color: #dce7ff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: .02em;
}
.hero .eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52,211,153,.25);
}
.hero h1 { color: #fff; max-width: 820px; }
.hero p.lead { color: #cfdcfa; max-width: 680px; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 34px;
  align-items: start;
  margin-top: 30px;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* Quick-answer box: AEO/GEO — a direct, extractable answer near the top */
.quick-answer {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 22px;
}
.quick-answer p { margin: 0; color: #eaf1ff; font-size: .98rem; }
.quick-answer strong { color: #fff; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}
.hero-trust .stat { min-width: 120px; }
.hero-trust .stat b { display: block; font-size: 1.5rem; color: #fff; }
.hero-trust .stat span { font-size: .82rem; color: #b9caf2; }

/* Best-code spotlight card in hero */
.spotlight-card {
  background: var(--surface);
  color: var(--ink-900);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.spotlight-card .tag {
  display: inline-block;
  background: var(--success-100);
  color: var(--success-600);
  font-weight: 700;
  font-size: .75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.spotlight-card .discount {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--accent-600);
  line-height: 1;
}
.spotlight-card .code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 2px dashed var(--brand-500);
  background: var(--brand-100);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 16px 0;
}
.spotlight-card .code-row .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--brand-800);
  letter-spacing: .02em;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand-600); color: #fff; }
.btn-primary:hover { background: var(--brand-700); color: #fff; }
.btn-accent { background: var(--accent-500); color: #fff; }
.btn-accent:hover { background: var(--accent-600); color: #fff; }
.btn-outline {
  background: transparent;
  color: var(--ink-900);
  border: 1.5px solid var(--ink-300);
}
.btn-outline:hover { border-color: var(--brand-600); color: var(--brand-700); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn[disabled] { opacity: .6; cursor: default; }

/* ---------- Sections & cards ---------- */
main { display: block; }
.section {
  padding: 52px 0;
}
.section-head {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}
.section-head.left { margin-left: 0; text-align: left; }
.eyebrow-sm {
  display: inline-block;
  color: var(--brand-700);
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

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

/* Clickable feature image (e.g. "Why iFunds" banner) */
.feature-image {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease, box-shadow .15s ease;
}
.feature-image:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-image img { width: 100%; height: auto; display: block; }

/* "Why iFunds" layout: desktop keeps buttons under the text column, image on the right;
   mobile puts the buttons right after the heading, above the text and image. */
.why-grid {
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "text image"
    "buttons image";
  align-items: start;
}
.why-text { grid-area: text; }
.why-buttons { grid-area: buttons; display: flex; gap: 12px; flex-wrap: wrap; align-self: start; }
.why-image { grid-area: image; }
@media (max-width: 620px) {
  .why-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "buttons"
      "text"
      "image";
  }
  .why-buttons { margin-bottom: 4px; }
}

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Coupon cards */
.coupon-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow .15s ease, transform .15s ease;
}
.coupon-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--brand-500); }
.coupon-card.is-featured { border-color: var(--accent-500); background: linear-gradient(180deg, var(--accent-100), var(--surface) 40%); }
.coupon-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.coupon-badge {
  background: var(--brand-100);
  color: var(--brand-700);
  font-weight: 800;
  font-size: 1.05rem;
  border-radius: 10px;
  padding: 8px 12px;
  min-width: 58px;
  text-align: center;
  line-height: 1.1;
}
.coupon-badge small { display: block; font-size: .6rem; font-weight: 700; color: var(--brand-500); }
.coupon-card h3 { margin: 0; font-size: 1rem; color: var(--ink-900); }
.coupon-meta { color: var(--ink-500); font-size: .86rem; margin: 0; }
.coupon-code-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1.5px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: var(--ink-100);
}
.coupon-code-box .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
  letter-spacing: .03em;
  color: var(--ink-900);
}
.copy-btn {
  background: var(--brand-600);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
}
.copy-btn:hover { background: var(--brand-700); }
.copy-btn.is-copied { background: var(--success-600); }

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--ink-900);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .88rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* Table */
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: .92rem; }
th, td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
thead th { background: var(--brand-900); color: #fff; font-weight: 700; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--brand-100); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.steps li {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.steps .num {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.steps p { margin: 4px 0 0; color: var(--ink-500); }
.steps strong { color: var(--ink-900); }

/* Checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checklist li {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 4px 0;
}
.checklist .ico {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--success-100);
  color: var(--success-600);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem;
}

/* FAQ accordion */
.faq { border-top: 1px solid var(--border); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 4px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}
.faq-q .icon { flex: none; color: var(--brand-600); font-size: 1.2rem; transition: transform .2s ease; }
.faq-item[open] .faq-q .icon { transform: rotate(45deg); }
.faq-a { padding: 0 4px 18px; color: var(--ink-500); }
.faq-a p:last-child { margin-bottom: 0; }

/* Callout / disclosure */
.callout {
  border-radius: var(--radius-md);
  padding: 18px 20px;
  border: 1px solid var(--border);
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: .92rem;
}
.callout.warn { background: var(--accent-100); color: #8a3b0c; }

/* Meta row (last updated / reviewed by) */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--ink-500);
  font-size: .85rem;
  margin-bottom: 8px;
}
.meta-row b { color: var(--ink-700); }

/* Breadcrumbs */
.breadcrumbs {
  font-size: .82rem;
  color: var(--ink-500);
  padding: 12px 0;
}
.breadcrumbs a { color: var(--ink-500); }
.breadcrumbs a:hover { color: var(--brand-700); }
.breadcrumbs .sep { margin: 0 6px; }

/* Pills / nav-in-page */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 6px; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-700);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: .85rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--brand-500); color: var(--brand-700); text-decoration: none; }

/* Section tint */
.section.tint { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #d7e3fb; max-width: 560px; margin-left: auto; margin-right: auto; }
.cta-band .btn-accent { margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brand-900);
  color: #b9c6ea;
  padding: 46px 0 24px;
  margin-top: 40px;
  font-size: .9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 14px; }
.site-footer .brand { color: #fff; margin-bottom: 10px; }
.site-footer p { color: #a9b8de; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-links a { color: #b9c6ea; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  font-size: .82rem;
  color: #8ea0cc;
}
.footer-disclosure {
  max-width: 900px;
  color: #8ea0cc;
  font-size: .8rem;
  padding-top: 18px;
  line-height: 1.6;
}

/* Utilities */
.mt-0 { margin-top: 0; }
.mt-lg { margin-top: 30px; }
.text-center { text-align: center; }
.muted { color: var(--ink-500); }
.small { font-size: .85rem; }

/* ---------- Small-screen tightening (phones) ---------- */
@media (max-width: 560px) {
  .container { padding: 0 16px; }
  .section { padding: 38px 0; }
  .hero { padding: 40px 0 32px; }
  .card, .coupon-card { padding: 18px; }
  .spotlight-card { padding: 20px; }
  .cta-band { padding: 32px 20px; }
  .steps li { padding: 14px 16px; gap: 12px; }
  th, td { padding: 12px; font-size: .86rem; }
  .btn { padding: 12px 18px; font-size: .9rem; }
  .hero-trust { gap: 14px 22px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
