/* ==========================================================================
   AGENTFINTECH.DIGITAL — Razorpay-style Design System v6
   Light theme · image-led · CSS NEVER hides content (JS animates at runtime)
   ========================================================================== */
:root {
  --bg: #FFFFFF;
  --bg-2: #F6F9FE;
  --surface: #FFFFFF;
  --ink: #16233B;
  --ink-2: #1F2E4D;
  --text: #22314E;
  --text-2: #55627D;
  --text-3: #8B96AC;
  --border: #E6ECF5;
  --border-2: #D8E1EF;
  --primary: #2B6EF6;
  --primary-2: #1F56D0;
  --primary-soft: #EAF1FF;
  --success: #16803C; --success-soft: #E5F5EB;
  --warning: #B45309; --warning-soft: #FCF1DF;
  --danger: #C92A3D;  --danger-soft: #FBE9EC;
  --font-head: "Manrope", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-m: 10px; --r-l: 14px; --r-xl: 18px;
  --sh-1: 0 1px 2px rgba(22,35,59,.05), 0 12px 32px -18px rgba(22,35,59,.18);
  --sh-2: 0 24px 60px -24px rgba(22,35,59,.35);
  --container: 1180px;
  --header-h: 72px;
  --topbar-h: 40px;
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--topbar-h) + 16px); }
body { font-family: var(--font-body); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--bg); overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.14; letter-spacing: -.02em; }
h2 { font-size: 2.3rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 700; }
.container { width: 100%; max-width: var(--container); padding-left: 24px; padding-right: 24px; margin-left: auto; margin-right: auto; }
.sr-only { position: absolute; 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; z-index: 300; background: var(--surface); color: var(--ink); padding: 12px 20px; }
.skip-link:focus { left: 0; }
.icon { width: 22px; height: 22px; flex: none; }

/* ---------- TOPBAR + HEADER ---------- */
.topbar { position: relative; z-index: 160; height: var(--topbar-h); background: var(--primary-soft); border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: .82rem; color: var(--ink-2); }
.topbar-row a { color: var(--primary); font-weight: 600; }
.header { position: sticky; top: 0; z-index: 150; height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); }
.header.scrolled { box-shadow: var(--sh-1); }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-text { font-family: var(--font-head); font-size: 1.1rem; font-weight: 800; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; }
.brand-text small { font-family: var(--font-body); font-size: .64rem; font-weight: 500; color: var(--text-3); }
.logo-img { height: 36px; width: auto; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav-link { font-size: .92rem; font-weight: 500; color: var(--text-2); padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s ease; }
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s ease, opacity .3s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- BUTTONS ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 24px; border-radius: 8px; font-family: var(--font-body); font-size: .93rem; font-weight: 600; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: background .2s ease, transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.btn:active { transform: translateY(1px); }
.btn-sm { height: 40px; padding: 0 18px; font-size: .88rem; }
.btn-lg { height: 54px; padding: 0 30px; }
.btn-block { width: 100%; }
.btn.loading { opacity: .65; pointer-events: none; }
.btn-primary { background: var(--primary); color: #FFFFFF; box-shadow: 0 8px 20px -8px rgba(43,110,246,.6); }
.btn-primary:hover { background: var(--primary-2); transform: translateY(-1px); }
.btn-outline { border-color: var(--border-2); color: var(--ink); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-link { color: var(--primary); padding: 0 12px; }
.btn-link:hover { text-decoration: underline; }

/* ---------- HERO (light, Razorpay-style) ---------- */
.hero { padding: 72px 0 96px; background:
  radial-gradient(60% 80% at 85% 10%, #EAF1FF 0%, rgba(234,241,255,0) 60%),
  radial-gradient(40% 60% at 5% 95%, #F0F6FF 0%, rgba(240,246,255,0) 55%),
  var(--bg); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: 18px; }
.hero h1 { font-size: 3.4rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.08; color: var(--ink); }
.hl-accent { color: var(--primary); display: block; }.hero-lead { color: var(--text-2); font-size: 1.08rem; max-width: 52ch; margin-top: 20px; }
.hero-ctas { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 32px; }

.hero-visual { position: relative; justify-self: center; width: min(420px, 100%); }
.hero-person { width: 100%; aspect-ratio: 4 / 4.6; border-radius: var(--r-xl); background-color: #E7F0FF; background-image: linear-gradient(160deg, #DCE9FF, #F2F7FF); background-size: cover; background-position: center top; box-shadow: var(--sh-2); }
.hero-chip { position: absolute; background: #FFFFFF; border: 1px solid var(--border); border-radius: 99px; padding: 10px 18px; font-size: .85rem; font-weight: 600; color: var(--ink); box-shadow: var(--sh-1); animation: chipFloat 5s ease-in-out infinite; }
.chip-1 { top: 10%; left: -14px; }
.chip-2 { top: 34%; right: -18px; animation-delay: -1.2s; }
.chip-3 { bottom: 30%; left: -20px; animation-delay: -2.4s; }
.chip-4 { bottom: 8%; right: -6px; animation-delay: -3.6s; }
@keyframes chipFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-brandcard { position: absolute; right: -24px; top: 18%; background: linear-gradient(160deg, #2B6EF6, #1F56D0); color: #FFFFFF; border-radius: var(--r-l); padding: 16px 20px; box-shadow: var(--sh-2); display: grid; gap: 4px; }
.hero-brandcard b { font-family: var(--font-head); font-size: 1.05rem; }
.hero-brandcard small { font-size: .6rem; letter-spacing: .12em; opacity: .85; }

/* ---------- MARQUEE ---------- */
.mq { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 18px 0; overflow: hidden; }
.mq-track { display: flex; gap: 64px; width: max-content; animation: mq 30s linear infinite; }
.mq-track span { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; letter-spacing: .06em; color: #9AA7BC; white-space: nowrap; }
@keyframes mq { to { transform: translateX(-50%); } }

/* ---------- SUBNAV ---------- */
.subnav { position: sticky; top: var(--header-h); z-index: 140; background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav-row { display: flex; align-items: center; gap: 20px; height: 58px; }
.subnav-label { font-size: .9rem; color: var(--text-2); white-space: nowrap; }
.subnav-links { display: flex; gap: 26px; overflow-x: auto; }
.subnav-link { font-family: var(--font-head); font-size: .98rem; font-weight: 700; color: var(--text-2); padding: 16px 0 14px; border-bottom: 3px solid transparent; transition: color .2s ease, border-color .2s ease; white-space: nowrap; }
.subnav-link:hover { color: var(--ink); }
.subnav-link.active { color: var(--ink); border-bottom-color: #2FB37C; }

/* ---------- SECTIONS / PRODUCT CARDS ---------- */
.section { padding: 96px 0; }
.section-tint { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-dark { background: var(--ink); color: #DDE6F5; }
.section-dark h2 { color: #FFFFFF; }
.sec-lead { color: var(--text-2); margin-top: 12px; max-width: 60ch; }
.sec-lead-inv { color: #A9B8D6; }
.sec-note { margin-top: 32px; font-size: .83rem; color: var(--text-3); }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px; }
.eyebrow-inv { color: #7FB0FF; }
.product-sec { padding-top: 72px; padding-bottom: 72px; }
.product-sec h2 { margin-bottom: 6px; }

.pcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.pcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 14px; transition: transform .3s ease, box-shadow .3s ease; }
.pcard:hover { transform: translateY(-4px); box-shadow: var(--sh-1); }
.pcard-media { position: relative; height: 230px; border-radius: var(--r-m); background-color: #E7F0FF; background-image: linear-gradient(150deg, #DCE9FF 0%, #F0F6FF 60%, #E4EEFF 100%); background-size: cover; background-position: center; overflow: hidden; }
.pcard-bubble {
  position: absolute; left: 12px; bottom: 12px; right: 12px;
  display: flex; align-items: center; gap: 10px;
  background: #FFFFFF; border-radius: 10px; padding: 10px 14px;
  box-shadow: 0 8px 24px -10px rgba(22,35,59,.35);
  font-size: .8rem; font-weight: 600; color: var(--ink);
}
.pcard-tag {
  font-style: normal; flex: none;
  background: #E5F5EB; color: #16803C;
  border-radius: 6px; padding: 3px 8px;
  font-size: .64rem; font-weight: 700; letter-spacing: .06em;
}.pcard h3 { margin: 16px 6px 4px; }
.pcard p { margin: 0 6px 10px; font-size: .88rem; color: var(--text-2); }

.wl-cta { margin-top: 28px; text-align: center; }

/* ---------- DASHBOARD MOCK ---------- */
.dash { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-1); overflow: hidden; margin-top: 32px; }
.dash-top { display: flex; align-items: center; gap: 14px; padding: 14px 20px; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.dash-dots { display: flex; gap: 6px; }
.dash-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border-2); }
.dash-title { font-size: .84rem; font-weight: 600; color: var(--text-2); }
.dash-sample { margin-left: auto; font-size: .68rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 99px; padding: 4px 12px; }
.dash-body { display: grid; grid-template-columns: 180px 1fr; min-height: 360px; }
.dash-side { border-right: 1px solid var(--border); padding: 18px 14px; display: grid; gap: 10px; align-content: start; }
.dash-side span { height: 28px; border-radius: 8px; background: var(--bg-2); }
.dash-side span.active { background: var(--primary-soft); border: 1px solid rgba(43,110,246,.25); }
.dash-main { padding: 22px; }
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.dstat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 16px 18px; }
.dstat small { display: block; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.dstat b { font-family: var(--font-head); font-size: 1.28rem; font-weight: 800; color: var(--ink); }
.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 14px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: .87rem; }
.dash-table th { text-align: left; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.dash-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); }
.dash-table td:nth-child(2) { color: var(--ink); font-weight: 600; }
.dash-table tr:last-child td { border-bottom: 0; }
.chip-ok { background: var(--success-soft); color: var(--success); }
.chip-warn { background: var(--warning-soft); color: var(--warning); }
.chip { display: inline-block; font-size: .7rem; font-weight: 600; border-radius: 99px; padding: 4px 11px; }
.dash-sidecard { border: 1px solid var(--border); border-radius: var(--r-m); padding: 18px; display: grid; gap: 8px; align-content: start; }
.dash-sidecard small { font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.dash-sidecard b { font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; color: var(--ink); }
.dash-sidecard p { font-size: .83rem; color: var(--text-2); }

/* ---------- API ---------- */
.api-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: 64px; align-items: center; }
.api-endpoints { display: flex; flex-wrap: wrap; gap: 9px; margin: 26px 0 30px; }
.ep-pill { font-family: var(--font-mono); font-size: .78rem; color: #A9C3F5; border: 1px solid rgba(127,176,255,.3); background: rgba(255,255,255,.05); border-radius: 8px; padding: 7px 12px; }
.api-feats { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; }
.api-feats li { display: flex; gap: 12px; }
.api-feats .icon { color: #6FA0FF; margin-top: 2px; }
.api-feats b { display: block; color: #FFFFFF; font-family: var(--font-head); font-size: .92rem; font-weight: 700; }
.api-feats span { font-size: .82rem; color: #A9B8D6; }
.term { background: #060D1C; border: 1px solid rgba(255,255,255,.09); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--sh-2); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.term-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.16); }
.term-bar span { margin-left: 8px; font-family: var(--font-mono); font-size: .74rem; color: #A9B8D6; }
.term pre { padding: 22px; overflow-x: auto; font-family: var(--font-mono); font-size: .82rem; line-height: 1.85; color: #C9D8F2; }
.tok-m { color: #FFC66B; font-weight: 700; } .tok-k { color: #8FB6FF; } .tok-s { color: #6EE7B7; }
.tok-p { color: #7DD3FC; } .tok-b { color: #FFC66B; } .tok-c { color: #5F7399; }

/* ---------- PERSONAS ---------- */
.persona-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 36px; }
.persona { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 14px; transition: transform .3s ease, box-shadow .3s ease; }
.persona:hover { transform: translateY(-4px); box-shadow: var(--sh-1); }
.persona-photo { height: 250px; border-radius: var(--r-m); background-color: #E7F0FF; background-image: linear-gradient(150deg, #DCE9FF, #F0F6FF); background-size: cover; background-position: center top; filter: grayscale(1); }
.persona h3 { margin: 16px 6px 4px; }
.persona p { margin: 0 6px 10px; font-size: .88rem; color: var(--text-2); }

/* ---------- FAQ ---------- */
.faq-wrap { max-width: 760px; }
.faq-list { margin-top: 28px; }
.faq-list details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-list details:first-child { border-top: 1px solid var(--border); }
.faq-list summary { cursor: pointer; font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--primary); transition: transform .25s ease; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-list details p { margin-top: 12px; color: var(--text-2); max-width: 62ch; }

/* ---------- CONTACT ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: start; }
.contact-meta { list-style: none; padding: 0; margin-top: 32px; display: grid; gap: 16px; }
.contact-meta li { display: flex; align-items: center; gap: 13px; }
.contact-meta .icon { color: var(--primary); width: 20px; height: 20px; }
.contact-meta a, .contact-meta span { font-weight: 600; font-size: .95rem; color: var(--ink); }
.contact-meta a:hover { color: var(--primary); }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 32px; box-shadow: var(--sh-1); }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.f { margin-bottom: 16px; }
.f label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink); margin-bottom: 7px; }
.f label em { color: var(--danger); font-style: normal; }
.f input, .f select, .f textarea { width: 100%; height: 48px; padding: 0 15px; border: 1px solid var(--border-2); border-radius: 8px; font-family: var(--font-body); font-size: .93rem; font-weight: 500; color: var(--ink); background: var(--bg-2); transition: border-color .2s ease, box-shadow .2s ease, background .2s ease; }
.f select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='8' viewBox='0 0 13 8'%3E%3Cpath d='M1 1l5.5 5.5L12 1' fill='none' stroke='%2355627D' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; }
.f textarea { height: 112px; padding: 13px 15px; resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus { outline: 0; background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.fe { display: none; font-size: .76rem; color: var(--danger); margin-top: 6px; font-weight: 500; }
.f.err input, .f.err textarea { border-color: var(--danger); }
.f.err .fe { display: block; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 14px 18px; border-radius: 10px; font-size: .9rem; font-weight: 500; margin-bottom: 20px; }
.alert-s { background: var(--success-soft); color: var(--success); border: 1px solid rgba(22,128,60,.25); }
.alert-e { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(201,42,61,.25); }

/* ---------- TOAST ---------- */
.toast { position: fixed; bottom: 24px; right: 24px; z-index: 250; max-width: 360px; padding: 14px 18px; background: var(--ink); color: #FFFFFF; border-radius: 12px; font-size: .9rem; font-weight: 500; border-left: 3px solid var(--success); box-shadow: var(--sh-2); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.toast.show { opacity: 1; transform: none; }
.toast.error { border-left-color: var(--danger); }

/* ---------- FOOTER (light) ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); color: var(--text-2); padding: 64px 0 28px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); }
.brand-dark .brand-text { color: var(--ink); }
.footer-about { max-width: 34ch; margin: 14px 0 18px; }
.footer-block { display: grid; gap: 4px; margin-bottom: 12px; }
.footer-block b { font-size: .72rem; letter-spacing: .1em; color: var(--ink); }
.footer-block span { font-size: .85rem; }
.footer-contact { display: grid; gap: 4px; }
.footer-contact a { color: var(--primary); font-weight: 500; }
.footer-col h4 { font-size: .74rem; font-weight: 700; letter-spacing: .1em; color: var(--ink); margin-bottom: 16px; }
.footer-col a { display: block; padding: 5px 0; transition: color .2s ease; }
.footer-col a:hover { color: var(--primary); }
.footer-disclaimer { padding: 22px 0; font-size: .78rem; line-height: 1.7; color: var(--text-3); border-bottom: 1px solid var(--border); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 22px; font-size: .8rem; color: var(--text-3); }

/* ---------- AUTH PAGES ---------- */
.auth-page { min-height: 100vh; background: linear-gradient(160deg, #16233B, #12306B 120%); display: grid; align-items: center; justify-items: center; padding: 32px; }
.auth-wrap { width: 100%; max-width: 440px; display: grid; gap: 20px; }
.auth-brand { display: flex; align-items: center; gap: 12px; color: #FFFFFF; font-family: var(--font-head); font-size: 1.15rem; font-weight: 800; justify-content: center; }
.auth-card { background: var(--surface); border-radius: var(--r-xl); padding: 40px; box-shadow: 0 40px 80px -40px rgba(0,0,0,.7); }
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; }
.auth-sub { color: var(--text-2); font-size: .92rem; margin-bottom: 24px; }
.auth-alert { padding: 12px 16px; border-radius: 10px; font-size: .88rem; font-weight: 500; margin-bottom: 18px; }
.auth-alert.bad { background: var(--danger-soft); color: var(--danger); border: 1px solid #F5C6CE; }
.auth-alert.ok { background: var(--success-soft); color: var(--success); border: 1px solid #B8EBD4; }
.auth-foot { color: #93A6C9; font-size: .85rem; text-align: center; }
.auth-foot a { color: #FFFFFF; }
.panel-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.role-chip { background: var(--ink); color: #FFFFFF; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 99px; padding: 6px 14px; }
.logout { color: var(--primary); font-weight: 600; font-size: .9rem; }
.panel-note { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; font-size: .9rem; color: var(--text-2); line-height: 1.7; margin-bottom: 24px; }
.panel-note b { color: var(--ink); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1080px) {
  .section { padding: 80px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .hero-visual { justify-self: start; }
  .api-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .pcards, .persona-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .subnav-label { display: none; }
}
@media (max-width: 820px) {
  h2 { font-size: 1.8rem; }
  .hero h1 { font-size: 2.4rem; }
  .nav { position: fixed; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--border); padding: 8px 24px 20px; transform: translateY(-12px); opacity: 0; visibility: hidden; transition: transform .3s ease, opacity .3s ease, visibility .3s; }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav-link { padding: 15px 4px; border-bottom: 1px solid var(--border); font-size: 1rem; }
  .nav-toggle { display: flex; }
  .nav-actions { gap: 6px; }
  .dash-body { grid-template-columns: 1fr; }
  .dash-side { display: none; }
  .dash-cols { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .hero-chip { display: none; }
  .hero-brandcard { right: 8px; }
}
@media (max-width: 600px) {
  .section, .product-sec { padding: 64px 0; }
  .hero { padding: 48px 0 72px; }
  .hero h1 { font-size: 2rem; }
  .pcards, .persona-grid { grid-template-columns: 1fr; }
  .topbar-row { font-size: .74rem; }
  .g2 { grid-template-columns: 1fr; }
  .api-feats { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .form-card { padding: 22px; }
  .hero-ctas .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mq-track, .hero-chip { animation: none; }
  .btn, .pcard, .persona { transition: none; }
}
/* ---------- STICKY BOTTOM CTA DOCK ---------- */
.cta-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 180;
  background: var(--primary);
  box-shadow: 0 -10px 30px -12px rgba(22,35,59,.4);
  transform: translateY(100%);
  transition: transform .35s ease;
}
.cta-dock.show { transform: translateY(0); }
.dock-row { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 62px; }
.dock-text { color: #FFFFFF; font-weight: 600; font-size: .95rem; }
.dock-btn { background: #FFFFFF; color: var(--primary); box-shadow: none; height: 44px; }
.dock-btn:hover { background: #F0F6FF; transform: none; }
@media (max-width: 600px) {
  .dock-row { justify-content: space-between; padding: 10px 0; }
  .dock-text { font-size: .85rem; }
}
/* ==========================================================================
   HERO v2 — cutout person, auto-slides, light rays, layered chips
   ========================================================================== */

/* Kill the old "box" look */
.hero-visual { position: relative; width: 100%; max-width: 560px; aspect-ratio: 1 / 1.02; justify-self: center; }
.hero-person {
  position: absolute; left: 50%; bottom: 0;
  width: 88%; aspect-ratio: 4 / 4.8;
  transform: translateX(-50%);
  background-color: transparent;
  background-size: cover;
  background-position: center top;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  mix-blend-mode: multiply;   /* white bg of the photo disappears into hero */
  z-index: 2;
}

/* Diagonal light rays behind the person */
.hero-rays {
  position: absolute; right: -10%; top: -12%; width: 110%; height: 124%;
  background: repeating-linear-gradient(
    115deg,
    rgba(43,110,246,.10) 0 26px,
    rgba(43,110,246,.02) 26px 60px,
    rgba(111,160,255,.08) 60px 92px,
    rgba(255,255,255,0) 92px 150px
  );
  border-radius: 40% 60% 55% 45% / 50%;
  -webkit-mask-image: radial-gradient(70% 70% at 60% 45%, #000 40%, transparent 100%);
  mask-image: radial-gradient(70% 70% at 60% 45%, #000 40%, transparent 100%);
  animation: rayDrift 14s ease-in-out infinite alternate;
  z-index: 1;
}
@keyframes rayDrift {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(4deg) scale(1.06); }
}

/* Slide crossfade */
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; pointer-events: none; }
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-slide.active .hero-chip { animation: chipFloat 5s ease-in-out infinite; }
.hero-slide-copy { display: none; }
.hero-slide-copy.active { display: block; animation: copyIn .7s ease; }
@keyframes copyIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Layered chips — staggered right side like Razorpay */
.hero-chip {
  position: absolute; z-index: 3;
  background: #FFFFFF; border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 22px;
  font-size: .95rem; font-weight: 700; color: var(--ink);
  box-shadow: 0 14px 34px -14px rgba(22,35,59,.3);
}
.hc-1 { top: 8%;  left: -3%; }
.hc-2 { top: 40%; right: -4%; }
.hc-3 { bottom: 14%; left: -2%; animation-delay: -2.5s; }

/* Bottom caption pill (like their CEO tag) */
.hero-cap {
  position: absolute; z-index: 3; left: 6%; bottom: 2%;
  background: linear-gradient(120deg, rgba(43,110,246,.92), rgba(31,86,208,.92));
  color: #FFFFFF; border-radius: 99px; padding: 12px 24px;
  font-size: .9rem; font-weight: 700; box-shadow: var(--sh-2);
}
.hero-cap:hover { transform: translateY(-2px); }

/* Brand card — overlaps the person on the right */
.hero-brandcard { z-index: 4; right: -2%; top: 14%; }

/* Slide dots */
.hero-dots { position: absolute; z-index: 4; bottom: -6px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.hero-dot { width: 10px; height: 10px; border-radius: 50%; border: 0; background: var(--border-2); cursor: pointer; padding: 0; transition: background .25s ease, transform .25s ease; }
.hero-dot.active { background: var(--primary); transform: scale(1.25); }

/* Headline keeps two-tone */
.hl-accent { color: var(--primary); display: block; }

@media (max-width: 1080px) {
  .hero-visual { max-width: 480px; }
}
@media (max-width: 600px) {
  .hero-visual { aspect-ratio: 1 / 1.1; }
  .hero-person { width: 96%; }
  .hc-1 { left: 0; } .hc-2 { right: 0; } .hc-3 { left: 0; }
}
/* ==========================================================================
   MEGA MENU (v9) — full-width hover panels under the header
   ========================================================================== */
.nav-item { display: flex; align-items: center; }
.nav-item > .nav-link { display: inline-flex; align-items: center; height: var(--header-h); border-bottom: 3px solid transparent; padding: 0 2px; }
.nav-item.open > .nav-link,
.nav-item:hover > .nav-link { color: var(--primary); }
.nav-item.open > .nav-link { border-bottom-color: var(--primary); }

/* The panel: anchored to the sticky header, spans full width */
.mega {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 18px 18px;
  box-shadow: 0 40px 80px -40px rgba(22,35,59,.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 140;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.nav-item.open .mega { opacity: 1; visibility: visible; transform: none; }

.mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 48px;
  padding-top: 34px;
  padding-bottom: 42px;
}
.mega-head {
  font-family: var(--font-body);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--text-3);
  margin-bottom: 10px;
  padding-left: 4px;
}
.mega-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  transition: background .18s ease;
}
.mega-item:hover { background: var(--primary-soft); }
.mega-icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  display: grid; align-items: center; justify-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.mega-icon .icon { width: 18px; height: 18px; }
.mega-item:hover .mega-icon { background: var(--primary); color: #FFFFFF; }
.mega-txt b {
  display: block;
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.mega-txt small { font-size: .8rem; color: var(--text-2); line-height: 1.45; display: block; margin-top: 2px; }
.new-badge {
  font-style: normal;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: #16803C;
  background: #E5F5EB;
  border-radius: 6px;
  padding: 2px 7px;
  vertical-align: 2px;
}

/* ---------- Mobile: mega becomes accordion inside the drawer ---------- */
@media (max-width: 820px) {
  .mega {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    max-height: none;
    overflow: visible;
    padding: 4px 0 10px;
  }
  .nav-item.open .mega { display: block; }
  .mega-grid { grid-template-columns: 1fr; gap: 8px; padding: 0 8px 8px; }
  .mega-item { padding: 10px 8px; }
  .nav-item > .nav-link { height: auto; width: 100%; justify-content: space-between; }
  .nav-item.has-mega > .nav-link::after {
    content: "+";
    font-size: 1.2rem;
    color: var(--text-2);
  }
  .nav-item.open.has-mega > .nav-link::after { content: "–"; }
}
<?php
declare(strict_types=1);
// AGENTFINTECH.DIGITAL — Premium landing v7 (Razorpay-pattern polish)

require __DIR__ . '/includes/functions.php';
start_session();
secure_headers();

 $c     = require __DIR__ . '/includes/content.php';
 $flash = get_flash();

render_header('Fintech Infrastructure for Digital Businesses');
?>

<!-- HERO — auto-rotating slides -->
<section class="hero" id="home" aria-labelledby="heroTitle">
  <div class="container hero-grid">
    <div class="hero-copy">
      <div class="hero-slides-copy">
      <?php foreach ($c['slides'] as $i => $s): ?>
        <div class="hero-slide-copy<?= $i === 0 ? ' active' : '' ?>" data-slide="<?= $i ?>">
          <h1 id="heroTitle<?= $i ?>">
            <span class="hl-accent"><?= e($s['accent']) ?></span>
            <?= e($s['rest']) ?>
          </h1>
        </div>
      <?php endforeach; ?>
      </div>
      <p class="hero-lead"><?= e($c['hero_lead']) ?></p>
      <div class="hero-ctas">
        <a class="btn btn-primary btn-lg" href="#contact"><?= e($c['hero_cta']) ?></a>
        <a class="btn btn-link btn-lg" href="#contact"><?= e($c['hero_cta2']) ?></a>
      </div>
    </div>

    <div class="hero-visual" id="heroVisual" aria-hidden="true">
      <div class="hero-rays"></div>

      <?php foreach ($c['slides'] as $i => $s): ?>
        <div class="hero-slide<?= $i === 0 ? ' active' : '' ?>" data-slide="<?= $i ?>">
          <div class="hero-person" style="background-image:url('<?= asset('images/' . $s['img']) ?>')"></div>
          <span class="hero-chip hc-1"><?= e($s['chips'][0]) ?></span>
          <span class="hero-chip hc-2"><?= e($s['chips'][1]) ?></span>
          <span class="hero-chip hc-3"><?= e($s['chips'][2]) ?></span>
          <a class="hero-cap" href="<?= e($s['href']) ?>"><?= e($s['cap']) ?> ↗</a>
        </div>
      <?php endforeach; ?>

      <div class="hero-brandcard">
        <b><?= e(setting('site_name')) ?></b>
        <small>POWERED BY<br><?= e(strtoupper(setting('powered_by'))) ?></small>
      </div>

      <div class="hero-dots" role="tablist" aria-label="Hero slides">
        <?php foreach ($c['slides'] as $i => $s): ?>
          <button class="hero-dot<?= $i === 0 ? ' active' : '' ?>" data-slide="<?= $i ?>"
                  aria-label="Slide <?= $i + 1 ?>"></button>
        <?php endforeach; ?>
      </div>
    </div>
  </div>
</section>

<!-- INDUSTRY MARQUEE -->
<div class="mq" aria-hidden="true">
  <div class="mq-track">
    <?php for ($r = 0; $r < 2; $r++): foreach ($c['industries'] as $w): ?>
      <span><?= e($w) ?></span>
    <?php endforeach; endfor; ?>
  </div>
</div>

<!-- STICKY SUB-NAV -->
<div class="subnav" id="subnav">
  <div class="container subnav-row">
    <span class="subnav-label"><?= e($c['subnav_label']) ?></span>
    <div class="subnav-links">
      <?php foreach ($c['products'] as $p): ?>
        <a class="subnav-link" href="#<?= e($p['id']) ?>" data-subnav="<?= e($p['id']) ?>"><?= e($p['nav']) ?></a>
      <?php endforeach; ?>
    </div>
  </div>
</div>

<!-- PRODUCT SECTIONS -->
<?php foreach ($c['products'] as $p): ?>
<section class="section product-sec" id="<?= e($p['id']) ?>" aria-labelledby="t-<?= e($p['id']) ?>">
  <div class="container">
    <h2 id="t-<?= e($p['id']) ?>" data-reveal><?= e($p['title']) ?></h2>
    <p class="sec-lead" data-reveal><?= e($p['lead']) ?></p>

    <?php if (!empty($p['cards'])): ?>
      <div class="pcards">
        <?php foreach ($p['cards'] as $i => [$img, $tag, $msg, $ct, $cd]): ?>
          <article class="pcard" data-reveal data-delay="<?= $i * 80 ?>">
            <div class="pcard-media" style="background-image:url('<?= asset('images/' . $img) ?>')">
              <span class="pcard-bubble">
                <i class="pcard-tag"><?= e($tag) ?></i>
                <span><?= e($msg) ?></span>
              </span>
            </div>
            <h3><?= e($ct) ?></h3>
            <p><?= e($cd) ?></p>
          </article>
        <?php endforeach; ?>
      </div>
    <?php else: ?>
      <figure class="dash" data-reveal>
        <figcaption class="dash-top">
          <span class="dash-dots"><i></i><i></i><i></i></span>
          <span class="dash-title"><?= e(setting('site_name')) ?> · Your Brand · Operations</span>
          <span class="dash-sample">Sample data</span>
        </figcaption>
        <div class="dash-body">
          <div class="dash-side" aria-hidden="true"><span class="active"></span><span></span><span></span><span></span><span></span></div>
          <div class="dash-main">
            <div class="dash-stats">
              <div class="dstat"><small>Wallet balance</small><b data-count="1248560" data-prefix="₹">₹12,48,560</b></div>
              <div class="dstat"><small>Today's collections</small><b data-count="342180" data-prefix="₹">₹3,42,180</b></div>
              <div class="dstat"><small>Payouts today</small><b data-count="198240" data-prefix="₹">₹1,98,240</b></div>
              <div class="dstat"><small>Success rate</small><b data-count="99.2" data-decimals="1" data-suffix="%">99.2%</b></div>
              <div class="dstat"><small>Active agents</small><b data-count="482">482</b></div>
              <div class="dstat"><small>Commission (MTD)</small><b data-count="21540" data-prefix="₹">₹21,540</b></div>
            </div>
            <div class="dash-cols">
              <table class="dash-table">
                <caption class="sr-only">Recent transactions (sample)</caption>
                <thead><tr><th>Recent transactions</th><th>Amount</th><th>Status</th></tr></thead>
                <tbody>
                  <tr><td>Payout — vendor payment</td><td>₹25,000.00</td><td><span class="chip chip-ok">Success</span></td></tr>
                  <tr><td>Recharge — mobile</td><td>₹299.00</td><td><span class="chip chip-ok">Success</span></td></tr>
                  <tr><td>BBPS — electricity</td><td>₹1,840.00</td><td><span class="chip chip-warn">Processing</span></td></tr>
                  <tr><td>Collection — QR</td><td>₹6,720.00</td><td><span class="chip chip-ok">Success</span></td></tr>
                </tbody>
              </table>
              <div class="dash-sidecard">
                <small>Settlement cycle</small><b>T+0 running</b>
                <p>Next window closes 18:00 IST. UTRs reconcile automatically against the ledger.</p>
                <span class="chip chip-ok">Ledger balanced</span>
              </div>
            </div>
          </div>
        </div>
      </figure>
      <div class="wl-cta" data-reveal>
        <a class="btn btn-primary" href="#contact">Request a White-Label Demo</a>
      </div>
    <?php endif; ?>
  </div>
</section>
<?php endforeach; ?>

<!-- DEVELOPERS -->
<section class="section section-dark" id="developers" aria-labelledby="apiTitle">
  <div class="container api-grid">
    <div data-reveal>
      <p class="eyebrow eyebrow-inv">Developers</p>
      <h2 id="apiTitle"><?= e($c['api_lead']) ?></h2>
      <p class="sec-lead sec-lead-inv"><?= e($c['api_sub']) ?></p>
      <div class="api-endpoints">
        <?php foreach ($c['api_endpoints'] as $ep): ?><code class="ep-pill"><?= e($ep) ?></code><?php endforeach; ?>
      </div>
      <ul class="api-feats">
        <?php foreach ($c['api_points'] as [$ic, $t, $d]): ?>
          <li><?= icon($ic) ?><div><b><?= e($t) ?></b><span><?= e($d) ?></span></div></li>
        <?php endforeach; ?>
      </ul>
    </div>
    <div class="term" data-reveal data-delay="120">
      <div class="term-bar"><i></i><i></i><i></i><span>api.<?= e(strtolower(setting('site_name', 'agentfintech'))) ?>.digital</span></div>
<pre><code><span class="tok-c"># Collect a payment</span>
<span class="tok-m">POST</span> <span class="tok-p">/v1/payments</span>
<span class="tok-k">Idempotency-Key</span>: <span class="tok-s">"ord_8842"</span>

{ <span class="tok-k">"amount"</span>: <span class="tok-s">"2500.00"</span>,
  <span class="tok-k">"method"</span>: <span class="tok-s">"upi"</span> }

<span class="tok-c"># 202 Accepted</span>
{ <span class="tok-k">"success"</span>: <span class="tok-b">true</span>,
  <span class="tok-k">"reference"</span>: <span class="tok-s">"TXN9F2C31"</span>,
  <span class="tok-k">"status"</span>: <span class="tok-s">"processing"</span> }</code></pre>
    </div>
  </div>
</section>

<!-- PERSONAS -->
<section class="section" id="about" aria-labelledby="perTitle">
  <div class="container">
    <h2 data-reveal><?= e($c['personas_title']) ?></h2>
    <p class="sec-lead" data-reveal><?= e($c['personas_lead']) ?></p>
    <div class="persona-grid">
      <?php foreach ($c['personas'] as $i => [$img, $name, $text]): ?>
        <article class="persona" data-reveal data-delay="<?= $i * 80 ?>">
          <div class="persona-photo" style="background-image:url('<?= asset('images/' . $img) ?>')"></div>
          <h3><?= e($name) ?></h3>
          <p><?= e($text) ?></p>
        </article>
      <?php endforeach; ?>
    </div>
    <p class="sec-note"><?= e($c['security_note']) ?></p>
  </div>
</section>

<!-- FAQ -->
<section class="section section-tint" id="faq" aria-labelledby="faqTitle">
  <div class="container faq-wrap">
    <h2 id="faqTitle">Questions, answered plainly.</h2>
    <div class="faq-list">
      <?php foreach ($c['faqs'] as [$q, $a]): ?>
        <details><summary><?= e($q) ?></summary><p><?= e($a) ?></p></details>
      <?php endforeach; ?>
    </div>
  </div>
</section>

<!-- CONTACT -->
<section class="section" id="contact" aria-labelledby="ctTitle">
  <div class="container contact-grid">
    <div data-reveal>
      <p class="eyebrow">Contact</p>
      <h2 id="ctTitle">Tell us what you're building.</h2>
      <p class="sec-lead">Share your requirement and we'll respond within one business day.</p>
      <ul class="contact-meta">
        <li><?= icon('mail') ?><a href="mailto:<?= e(setting('contact_email')) ?>"><?= e(setting('contact_email')) ?></a></li>
        <li><?= icon('call') ?><a href="tel:<?= e(preg_replace('/\s+/', '', setting('contact_phone'))) ?>"><?= e(setting('contact_phone')) ?></a></li>
        <li><?= icon('pin') ?><span><?= e(setting('contact_address')) ?></span></li>
      </ul>
    </div>
    <div data-reveal data-delay="100">
      <?php if ($flash): ?>
        <div class="alert <?= $flash['type'] === 'error' ? 'alert-e' : 'alert-s' ?>" role="alert"><?= e($flash['message']) ?></div>
      <?php endif; ?>
      <form class="form-card" id="leadForm" method="post" action="<?= base_url('contact.php') ?>" novalidate>
        <input type="hidden" name="csrf" value="<?= e(csrf_token()) ?>">
        <div class="hp" aria-hidden="true"><label>Leave empty<input type="text" name="website" tabindex="-1" autocomplete="off"></label></div>
        <div class="g2">
          <div class="f" data-field="name"><label for="f-name">Full Name <em>*</em></label><input id="f-name" name="name" required autocomplete="name" maxlength="100"><span class="fe"></span></div>
          <div class="f" data-field="company"><label for="f-company">Business Name</label><input id="f-company" name="company" autocomplete="organization" maxlength="150"></div>
        </div>
        <div class="g2">
          <div class="f" data-field="email"><label for="f-email">Email <em>*</em></label><input id="f-email" type="email" name="email" required autocomplete="email" maxlength="190"><span class="fe"></span></div>
          <div class="f" data-field="phone"><label for="f-phone">Mobile</label><input id="f-phone" type="tel" name="phone" autocomplete="tel" maxlength="20"><span class="fe"></span></div>
        </div>
        <div class="f" data-field="interest">
          <label for="f-interest">Requirement</label>
          <select id="f-interest" name="interest">
            <option>White-label platform</option><option>Custom FinTech development</option>
            <option>API integration</option><option>Mobile application</option><option>Something else</option>
          </select>
        </div>
        <div class="f" data-field="message"><label for="f-message">Message <em>*</em></label><textarea id="f-message" name="message" required maxlength="2000"></textarea><span class="fe"></span></div>
        <button class="btn btn-primary btn-block" type="submit">Send Enquiry</button>
      </form>
    </div>
  </div>
</section>

<!-- STICKY BOTTOM CTA DOCK -->
<div class="cta-dock" id="ctaDock" hidden>
  <div class="container dock-row">
    <span class="dock-text">Ready to build on <?= e(setting('site_name')) ?>?</span>
    <a class="btn btn-primary dock-btn" href="#contact"><?= e($c['dock_cta']) ?> →</a>
  </div>
</div>

<?php render_footer(); ?>