/* ============================================================
   iApprove marketing site — "Ledger" theme (light + dark).
   Trust & clarity: structured, hairline dividers, Fiori blue,
   IBM Plex, honest product views. Mirrors the app's design tokens.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --accent: #0a6ed1;
    --accent-ink: #0a5cb0;
    --accent-weak: #e8f1fb;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-2: #f1f5fa;
    --border: #e3e9f1;
    --border-2: #eef2f7;
    --ink: #0f2540;
    --muted: #56667e;
    --muted-2: #8a97ad;
    --good: #1a7d4f;
    --good-bg: #e4f4ec;
    --font: "IBM Plex Sans", system-ui, "Segoe UI", Roboto, -apple-system, sans-serif;
    --mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
    --radius: 10px;
    --shadow-sm: 0 1px 2px rgba(16,30,60,.05), 0 1px 3px rgba(16,30,60,.06);
    --shadow-md: 0 18px 40px -22px rgba(10,60,120,.4);
    --wrap: 1120px;
}
html[data-theme="dark"] {
    --accent: #3a93e6;
    --accent-ink: #7ab6f0;
    --accent-weak: #12294a;
    --bg: #0b1626;
    --surface: #10203a;
    --surface-2: #14243f;
    --border: #22364f;
    --border-2: #1a2b45;
    --ink: #e9f0fa;
    --muted: #93a6c2;
    --muted-2: #6b7d99;
    --good: #34d399;
    --good-bg: rgba(52,211,153,.13);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow-md: 0 18px 44px -22px rgba(0,0,0,.7);
}

html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background .25s ease, color .25s ease;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; width: 100%; }
.wrap-narrow { max-width: 760px; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 200; }
.skip-link:focus { left: 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font); font-size: 15px; font-weight: 600;
    padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
    cursor: pointer; transition: background .15s, border-color .15s, transform .15s;
    white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); color: #fff; }
.btn-ghost { color: var(--ink); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--muted-2); }

/* ---------- header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(1.5) blur(10px);
    border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 22px; height: 62px; }
.brand { font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.brand span { color: var(--accent); }
.primary-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.primary-nav a {
    color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 7px 12px; border-radius: 7px;
    transition: color .15s, background .15s;
}
.primary-nav a:hover { color: var(--ink); background: var(--surface-2); }
.primary-nav a.active { color: var(--accent-ink); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; cursor: pointer;
    background: transparent; color: var(--muted); border: 1px solid var(--border);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--muted-2); }
.theme-toggle .i-moon { display: none; }
html[data-theme="dark"] .theme-toggle .i-sun { display: none; }
html[data-theme="dark"] .theme-toggle .i-moon { display: block; }

.lang-menu { position: relative; }
.lang-menu summary {
    list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); color: var(--ink);
    font-size: 13px; font-weight: 600;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: var(--surface-2); }
.lang-menu .flag { font-size: 15px; }
.lang-list {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: var(--shadow-md); padding: 6px; z-index: 120;
}
.lang-list a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px; color: var(--ink); font-size: 14px; }
.lang-list a:hover { background: var(--surface-2); }
.lang-list a.active { color: var(--accent-ink); font-weight: 600; }

.nav-toggle { display: none; flex-direction: column; gap: 4px; width: 38px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: transparent; cursor: pointer; align-items: center; justify-content: center; }
.nav-toggle span { width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: .2s; }

/* ---------- generic section head ---------- */
section { position: relative; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(24px, 3vw, 34px); }
.section-head p { color: var(--muted); font-size: 17px; margin-top: 12px; }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-grid.hero-solo { grid-template-columns: 1fr; }
.hero-centered .hero-grid { grid-template-columns: 1fr; text-align: center; max-width: 820px; margin-inline: auto; }
.hero-centered .hero-cta, .hero-centered .hero-trust { justify-content: center; }
.eyebrow {
    display: inline-flex; align-items: center; font-size: 13px; font-weight: 600;
    color: var(--accent-ink); background: var(--accent-weak); padding: 5px 12px; border-radius: 999px; margin-bottom: 18px;
}
.hero-copy h1 { font-size: clamp(32px, 4.4vw, 50px); }
.hero-copy .lead { font-size: 18px; color: var(--muted); margin-top: 18px; max-width: 46ch; }
.hero-centered .hero-copy .lead { margin-inline: auto; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-trust { margin-top: 26px; font-size: 13.5px; color: var(--muted); }

.hero-visual { display: flex; justify-content: center; }
.hero-visual img { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-md); }

/* demo card */
.demo-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }
.dc-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.dc-t { font-weight: 600; font-size: 13px; }
.dc-id { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.dc-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border-2); font-size: 13.5px; }
.dc-k { color: var(--muted); }
.dc-v { font-weight: 600; }
.dc-amt { font-family: var(--mono); }
.pill-good { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--good); background: var(--good-bg); padding: 4px 10px; border-radius: 999px; }
.pill-good::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.dc-foot { display: flex; gap: 10px; padding: 14px 16px; }
.dc-approve { flex: 1; text-align: center; background: var(--good); color: #fff; font-weight: 600; font-size: 13px; padding: 10px; border-radius: 8px; }
.dc-reject { text-align: center; color: var(--muted); font-weight: 600; font-size: 13px; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border); }

/* ---------- stats ---------- */
.stats { padding: 26px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 26px 22px; text-align: center; }
.stat .n { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { margin-top: 6px; font-size: 13.5px; color: var(--muted); }

/* ---------- features ---------- */
.features { padding: 56px 0; }
.features-grid { display: grid; gap: 20px; }
.features-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.features-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.features-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.ficon { width: 42px; height: 42px; border-radius: 10px; background: var(--accent-weak); color: var(--accent-ink); display: grid; place-items: center; margin-bottom: 16px; }
.feature h3 { font-size: 17px; margin-bottom: 7px; }
.feature p { color: var(--muted); font-size: 14.5px; }

/* ---------- logos ---------- */
.logos { padding: 40px 0; }
.logos-head { text-align: center; color: var(--muted-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 22px; }
.logos-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 34px; }
.logos-row img { max-height: 34px; width: auto; opacity: .7; filter: grayscale(1); }
html[data-theme="dark"] .logos-row img { opacity: .8; filter: grayscale(1) brightness(2); }

/* ---------- pricing ---------- */
.pricing { padding: 56px 0; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm); }
.plan.featured { border-color: var(--accent); box-shadow: var(--shadow-md); position: relative; }
.plan-name { font-weight: 700; font-size: 15px; color: var(--accent-ink); text-transform: uppercase; letter-spacing: .05em; }
.plan-price { font-size: 28px; font-weight: 700; margin: 12px 0 4px; letter-spacing: -.02em; }
.plan-price span { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.plan-features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 9px; }
.plan-features li { position: relative; padding-left: 24px; font-size: 14px; color: var(--ink); }
.plan-features li::before { content: ""; position: absolute; left: 0; top: 7px; width: 14px; height: 8px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg); }
.plan .btn { margin-top: auto; justify-content: center; }

/* ---------- faq ---------- */
.faq { padding: 56px 0; }
.faq-list { display: grid; gap: 10px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 18px; }
.faq-item summary { list-style: none; cursor: pointer; font-weight: 600; font-size: 16px; padding: 14px 0; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--muted-2); font-size: 20px; font-weight: 400; }
.faq-item[open] summary::after { content: "–"; }
.faq-a { color: var(--muted); font-size: 15px; padding: 0 0 16px; }

/* ---------- quote ---------- */
.quote { padding: 56px 0; }
.quote-inner { text-align: center; }
.quote blockquote { font-size: clamp(20px, 2.6vw, 27px); font-weight: 500; line-height: 1.4; letter-spacing: -.01em; margin: 0; }
.quote-by { display: inline-flex; align-items: center; gap: 12px; margin-top: 24px; }
.quote-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.qa-name { display: block; font-weight: 600; font-size: 14.5px; }
.qa-role { display: block; color: var(--muted); font-size: 13px; }

/* ---------- cta ---------- */
.cta { padding: 30px 0 64px; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
    background: linear-gradient(150deg, #0a6ed1 0%, #0a3f86 100%); color: #fff; border-radius: 18px; padding: 40px 44px; }
.cta-boxed .cta-inner { background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cta-copy h2 { font-size: clamp(22px, 3vw, 30px); }
.cta-copy p { margin-top: 8px; opacity: .9; font-size: 16px; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.cta .cta-actions .btn-ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.28); color: #fff; }
.cta .cta-actions .btn-ghost:hover { background: rgba(255,255,255,.2); }
.cta-boxed .cta-actions .btn-ghost { background: var(--surface); border-color: var(--border); color: var(--ink); }

/* ---------- rich text / prose ---------- */
.richtext { padding: 40px 0; }
.prose { font-size: 16.5px; color: var(--ink); }
.prose h1 { font-size: 30px; margin: 0 0 14px; }
.prose h2 { font-size: 23px; margin: 1.5em 0 .5em; }
.prose h3 { font-size: 18px; margin: 1.3em 0 .4em; }
.prose p { margin: 0 0 1em; color: var(--muted); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; color: var(--muted); }
.prose li { margin: .3em 0; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--accent-weak); padding: 8px 16px; border-radius: 0 8px 8px 0; margin: 0 0 1em; }

/* ---------- media ---------- */
.media { padding: 30px 0; }
.media figure { margin: 0; }
.media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.media figcaption { text-align: center; color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.media .framed { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); background: var(--surface); }
.media .framed img { border: none; border-radius: 0; }
.frame-bar { display: flex; gap: 7px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.frame-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }

/* ---------- contact form ---------- */
.contact { padding: 40px 0 64px; }
.lead-form { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-sm); }
.lf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lead-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.lead-form input, .lead-form textarea {
    font-family: var(--font); font-size: 15px; color: var(--ink); background: var(--surface); font-weight: 400;
    border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%;
}
.lead-form input:focus, .lead-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.lf-full { margin-top: 16px; }
.lead-form button { margin-top: 18px; }
.lf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.lf-status { margin-top: 14px; font-size: 14.5px; font-weight: 600; }
.lf-status.ok { color: var(--good); }
.lf-status.err { color: #c0392b; }
.lead-form.sent .lf-grid, .lead-form.sent .lf-full, .lead-form.sent button { display: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 30px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 30px; padding: 44px 24px 30px; }
.footer-brand .brand { font-size: 19px; }
.footer-brand p { color: var(--muted); font-size: 14px; margin-top: 10px; max-width: 34ch; }
.footer-nav, .footer-legal { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a, .footer-legal a { color: var(--muted); font-size: 14px; }
.footer-nav a:hover, .footer-legal a:hover { color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--border-2); padding: 16px 24px; color: var(--muted-2); font-size: 13px; }

/* ---------- preview banner + 404 ---------- */
.preview-banner { background: #9a5a00; color: #fff; text-align: center; padding: 8px; font-weight: 600; font-size: 13.5px; }
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.nf-code { font-size: 72px; font-weight: 700; color: var(--accent); letter-spacing: -.03em; }
.notfound h1 { font-size: 26px; margin: 6px 0 10px; }
.notfound p { color: var(--muted); margin-bottom: 24px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; gap: 34px; }
    .hero-visual { order: -1; }
    .features-grid.cols-3, .features-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .primary-nav {
        display: none; position: absolute; top: 62px; left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 16px;
    }
    .primary-nav.open { display: flex; }
    .nav-toggle { display: flex; }
    .header-cta { display: none; }
    .features-grid.cols-2, .features-grid.cols-3, .features-grid.cols-4 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .lf-grid { grid-template-columns: 1fr; }
    .cta-inner { padding: 30px 24px; }
    .footer-inner { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 2px;
}
