/* xpense.ca - the public site. The logo's colours (blue X, green $, navy wordmark) and the app's own look. */
:root {
    --bg: #F4F7FC; --surface: #FFFFFF; --surface-2: #EEF3FB; --text: #10213A; --text-2: #4A5A72; --text-3: #7C8AA0;
    --border: #DCE3EE; --blue: #0757E8; --blue-text: #0A4FCC; --navy: #082C78; --green: #10B981; --green-text: #047857;
    --grad: linear-gradient(135deg, #0757E8 0%, #0F4CB8 56%, #082C78 100%);
    --grad-green: linear-gradient(135deg, #10B981 0%, #059669 100%);
    --shadow: 0 18px 48px rgba(16, 33, 58, 0.14); --shadow-sm: 0 4px 14px rgba(16, 33, 58, 0.08);
    --radius: 18px; --max: 1180px;
    color-scheme: light;
}
/* Dark: the visitor's system setting, unless they chose (data-theme on <html>, shared with the app's "x-theme"). */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0A1222; --surface: #111D33; --surface-2: #0D182B; --text: #EAF0F8; --text-2: rgba(234, 240, 248, .74); --text-3: rgba(234, 240, 248, .52);
        --border: rgba(148, 170, 210, .20); --blue: #3D7BFF; --blue-text: #8AB4FF; --green-text: #34D399;
        --shadow: 0 18px 48px rgba(0, 0, 0, .5); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
        --grad-text: linear-gradient(90deg, #6EA8FF 0%, #34D399 100%);
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #0A1222; --surface: #111D33; --surface-2: #0D182B; --text: #EAF0F8; --text-2: rgba(234, 240, 248, .74); --text-3: rgba(234, 240, 248, .52);
    --border: rgba(148, 170, 210, .20); --blue: #3D7BFF; --blue-text: #8AB4FF; --green-text: #34D399;
    --shadow: 0 18px 48px rgba(0, 0, 0, .5); --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
    --grad-text: linear-gradient(90deg, #6EA8FF 0%, #34D399 100%);
    color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; overflow-x: hidden;
       font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--blue-text); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 750; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--text-2); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: .8rem; font-weight: 800; text-transform: uppercase;
           letter-spacing: .08em; color: var(--blue-text); margin-bottom: 12px; }
.eyebrow::before { content: ""; width: 18px; height: 3px; border-radius: 2px; background: var(--green); }
mark.todo { background: #FEF3C7; color: #92400E; border-radius: 4px; padding: 0 4px; font-weight: 700; }
[hidden] { display: none !important; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px;
       font-weight: 750; font-size: 1rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s;
       white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 24px rgba(7, 87, 232, .28); }
.btn.green { background: var(--grad-green); color: #fff; box-shadow: 0 10px 24px rgba(16, 185, 129, .25); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .92rem; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; }

/* Header */
.site-head { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent);
             backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo img { height: 34px; width: auto; }
.logo .on-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .on-light { display: none; } :root:not([data-theme="light"]) .logo .on-dark { display: block; } }
:root[data-theme="dark"] .logo .on-light { display: none; } :root[data-theme="dark"] .logo .on-dark { display: block; }
.theme-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; width: 38px; height: 38px;
             display: inline-grid; place-items: center; cursor: pointer; }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun { display: none; } :root:not([data-theme="light"]) .theme-btn .moon { display: block; } }
:root[data-theme="dark"] .theme-btn .sun { display: none; } :root[data-theme="dark"] .theme-btn .moon { display: block; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a { color: var(--text-2); text-decoration: none; font-weight: 650; padding: 8px 12px; border-radius: 10px; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--surface-2); }
.nav .phone-only { display: none; }
@media (max-width: 960px) { body.menu-open .nav .phone-only { display: block; } body.menu-open.signed-in .nav .phone-only.when-out { display: none !important; } }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.lang { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.lang button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-weight: 750; font-size: .8rem; padding: 7px 9px; cursor: pointer; }
.lang button.on { background: var(--blue); color: #fff; }
.when-in { display: none !important; }
body.signed-in .when-in { display: inline-flex !important; }
body.signed-in .when-out { display: none !important; }
.menu-btn { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; width: 42px; height: 42px; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; }

/* Hero: a dark stage in the logo colours (in light and dark mode), the app screens tilted in light. */
.hero { position: relative; padding: 76px 0 96px; overflow: hidden; color: #EAF0F8; isolation: isolate;
        background: radial-gradient(1200px 600px at 85% -10%, rgba(7, 87, 232, .55), transparent 60%),
                    radial-gradient(900px 500px at -10% 110%, rgba(16, 185, 129, .28), transparent 60%),
                    linear-gradient(160deg, #061a45 0%, #08245e 45%, #0a1630 100%); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35;
                background-image: linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
                background-size: 44px 44px; -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%); }
.hero .orb { position: absolute; border-radius: 50%; filter: blur(60px); z-index: -1; animation: drift 14s ease-in-out infinite alternate; }
.hero .orb.a { width: 380px; height: 380px; background: rgba(61, 123, 255, .45); right: 8%; top: -120px; }
.hero .orb.b { width: 300px; height: 300px; background: rgba(16, 185, 129, .35); left: 30%; bottom: -160px; animation-delay: -6s; }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(-40px, 30px) scale(1.12); } }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1fr 1.18fr; gap: 56px; align-items: center; }
.hero .eyebrow { color: #8AB4FF; }
.hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.9rem); letter-spacing: -.02em; }
.hero h1 .accent { background: linear-gradient(90deg, #6EA8FF 0%, #3D7BFF 45%, #34D399 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .money { color: #34D399; }
.hero .lead { font-size: 1.2rem; color: rgba(234, 240, 248, .82); max-width: 34em; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 30px 0 22px; }
.hero .btn.primary { box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset, 0 14px 34px rgba(61, 123, 255, .55); }
.hero .btn.ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .22); backdrop-filter: blur(6px); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-weight: 650; color: var(--text-2); background: var(--surface);
        border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px; }
.hero .chip { color: rgba(234, 240, 248, .88); background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); }
.chip svg { width: 15px; height: 15px; color: var(--green); }

/* Screens: a browser window and a phone, tilted, with floating highlights */
.screens { position: relative; padding: 0 0 40px 0; perspective: 1800px; }
.tilt { transform: rotateY(-11deg) rotateX(5deg) rotateZ(.5deg); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2, .7, .2, 1); }
.screens:hover .tilt { transform: rotateY(-5deg) rotateX(2deg); }
.browser { border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.hero .browser { border-color: rgba(255, 255, 255, .14); box-shadow: 0 40px 90px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); background: #0d1a33; }
.browser .bar { display: flex; gap: 6px; align-items: center; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.hero .browser .bar { background: #0f1f3d; border-bottom-color: rgba(255, 255, 255, .08); }
.browser .bar i { width: 10px; height: 10px; border-radius: 50%; background: #F87171; } .browser .bar i:nth-child(2) { background: #FBBF24; } .browser .bar i:nth-child(3) { background: #34D399; }
.browser .bar span { margin-left: 10px; font-size: .75rem; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 2px 10px; }
.hero .browser .bar span { color: rgba(234, 240, 248, .6); background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.browser img { width: 100%; height: auto; }
.phone { position: absolute; right: -14px; bottom: -6px; width: 31%; min-width: 150px; border-radius: 28px; padding: 7px; background: #050b17;
         box-shadow: 0 30px 70px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1); transform: translateZ(60px) rotateY(-4deg); }
.phone img { border-radius: 21px; width: 100%; height: auto; }
.float { position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: .86rem; font-weight: 700;
         color: #10213A; background: rgba(255, 255, 255, .96); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); white-space: nowrap; animation: bob 5s ease-in-out infinite; z-index: 3; }
.float small { display: block; font-weight: 600; color: #4A5A72; font-size: .74rem; }
.float .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.float .dot svg { width: 17px; height: 17px; }
.float.f1 { left: -34px; top: 18%; } .float.f1 .dot { background: linear-gradient(135deg, #10B981, #059669); }
.float.f2 { left: 8%; bottom: 2%; animation-delay: -2.5s; } .float.f2 .dot { background: linear-gradient(135deg, #3D7BFF, #082C78); }
.float.f3 { right: 22%; top: -22px; animation-delay: -1.2s; } .float.f3 .dot { background: linear-gradient(135deg, #F59E0B, #D97706); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* Stats strip under the hero */
.stats { position: relative; z-index: 2; margin-top: -46px; }
.stats .inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border);
                border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.stat { padding: 22px 24px; border-left: 1px solid var(--border); }
.stat:first-child { border-left: 0; }
.stat b { display: block; font-size: 2rem; font-weight: 850; letter-spacing: -.02em; background: var(--grad-text, var(--grad)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { color: var(--text-2); font-size: .92rem; font-weight: 600; }

/* Fade in on scroll (only with JavaScript; never for people who ask for less motion) */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .2, 1); }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    html.js .reveal { opacity: 1; transform: none; transition: none; }
    .hero .orb, .float { animation: none; }
    .tilt, .screens:hover .tilt { transform: none; }
}

/* Sections */
section { padding: 70px 0; }
section.alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.sec-head { max-width: 760px; margin-bottom: 34px; }
.sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.sec-head.center .eyebrow { justify-content: center; }
.grid { display: grid; gap: 18px; }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
        transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; position: relative; }
.grid .card:hover { transform: translateY(-4px); box-shadow: 0 22px 46px rgba(7, 87, 232, .16); border-color: rgba(61, 123, 255, .45); }
section.alt .card { background: var(--bg); }
.card p { color: var(--text-2); margin: 0; }
.icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: var(--grad); color: #fff; margin-bottom: 14px;
        box-shadow: 0 10px 22px rgba(7, 87, 232, .28); }
.icon.g { background: linear-gradient(135deg, #10B981 0%, #059669 100%); box-shadow: 0 10px 22px rgba(16, 185, 129, .28); }
.icon svg { width: 22px; height: 22px; }

/* Steps */
.steps { counter-reset: s; }
.step { position: relative; padding-top: 58px; }
.step::before { counter-increment: s; content: counter(s); position: absolute; top: 22px; left: 22px; width: 34px; height: 34px; border-radius: 50%;
                display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; }

/* A feature row: text + screenshot */
.row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 44px; align-items: center; margin: 0 0 70px; }
.row:last-child { margin-bottom: 0; }
.row.flip > .shot { order: -1; }
.row ul { padding: 0; margin: 14px 0 0; list-style: none; }
.row li { position: relative; padding-left: 28px; margin: 8px 0; color: var(--text-2); }
.row li::before { content: ""; position: absolute; left: 0; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: rgba(16, 185, 129, .15)
                  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310B981' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/11px no-repeat; }
.shot { border-radius: 14px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.shot img { width: 100%; height: auto; }

/* Who it is for */
.who { display: flex; flex-direction: column; }
.who h3 { display: flex; align-items: center; gap: 10px; }
.who ul { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); }

/* Call to action band */
.cta { background: var(--grad); color: #fff; border-radius: 26px; padding: 46px; display: grid; grid-template-columns: 1.4fr auto; gap: 24px; align-items: center;
       box-shadow: 0 24px 60px rgba(7, 87, 232, .3); position: relative; overflow: hidden; }
.cta::after { content: "$"; position: absolute; right: 26%; top: -40px; font-size: 220px; font-weight: 900; color: rgba(16, 185, 129, .22); line-height: 1; }
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { color: rgba(255, 255, 255, .85); margin: 0; }
.cta .btn.ghost { background: #fff; color: var(--navy); border-color: #fff; }
.cta .actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

/* FAQ */
details.q { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 0 18px; margin-bottom: 10px; }
details.q summary { cursor: pointer; font-weight: 750; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.q summary::-webkit-details-marker { display: none; }
details.q summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--blue); }
details.q[open] summary::after { content: "–"; }
details.q div { color: var(--text-2); padding: 0 0 16px; }

/* Page header (inner pages) */
.page-head { padding: 54px 0 10px; }
.page-head .lead { font-size: 1.12rem; color: var(--text-2); max-width: 46em; }

/* Legal */
.legal { max-width: 860px; }
.legal h2 { font-size: 1.3rem; margin: 34px 0 10px; }
.legal h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.legal p, .legal li { color: var(--text-2); }
.legal ul { padding-left: 20px; }
.legal .meta { color: var(--text-3); font-size: .92rem; }
.legal .box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin: 18px 0; }
.toc { columns: 2; padding-left: 18px; color: var(--text-2); }

/* Contact */
.form { display: grid; gap: 14px; }
.form label { font-weight: 700; font-size: .9rem; display: grid; gap: 6px; }
.form input, .form textarea, .form select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
                                            padding: 12px 14px; width: 100%; }
.form textarea { min-height: 150px; resize: vertical; }
.form input:focus, .form textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.form .field-err { color: #DC2626; font-weight: 650; font-size: .82rem; }
.form input.bad { border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.msg { border-radius: 12px; padding: 12px 14px; font-weight: 650; }
.msg.ok { background: rgba(16, 185, 129, .12); color: var(--green-text); }
.msg.err { background: rgba(239, 68, 68, .12); color: #B91C1C; }

/* Footer */
.site-foot { background: #0B1830; color: rgba(234, 240, 248, .78); padding: 52px 0 28px; margin-top: 70px; }
.site-foot .cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.site-foot h4 { color: #fff; margin: 0 0 10px; font-size: .95rem; }
.site-foot a { color: rgba(234, 240, 248, .78); text-decoration: none; display: block; padding: 3px 0; }
.site-foot a:hover { color: #fff; }
.site-foot .logo img { height: 32px; }
.site-foot .small { font-size: .85rem; color: rgba(234, 240, 248, .55); margin-top: 30px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 18px;
                    display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }

/* Phones and tablets */
@media (max-width: 960px) {
    .hero .wrap, .row { grid-template-columns: 1fr; }
    .tilt, .screens:hover .tilt { transform: none; }
    .float.f1 { left: -6px; } .float.f3 { right: 10%; }
    .stats .inner { grid-template-columns: 1fr 1fr; }
    .stat:nth-child(3) { border-left: 0; } .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
    .row.flip > .shot { order: 0; }
    .grid.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.c3 { grid-template-columns: 1fr 1fr; }
    .cta { grid-template-columns: 1fr; padding: 32px; }
    .site-foot .cols { grid-template-columns: 1fr 1fr; }
    .nav { display: none; }
    .menu-btn { display: inline-grid; place-items: center; }
    body.menu-open .nav { display: flex; flex-direction: column; position: absolute; top: 68px; left: 0; right: 0; background: var(--surface);
                          border-bottom: 1px solid var(--border); padding: 10px 16px; margin: 0; box-shadow: var(--shadow-sm); }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .hero { padding: 40px 0 80px; }
    .float { font-size: .76rem; padding: 7px 10px; } .float small { display: none; } .float .dot { width: 24px; height: 24px; }
    .float.f2 { display: none; }
    .stat { padding: 16px; } .stat b { font-size: 1.5rem; }
    .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; }
    .head-actions .btn.ghost.when-out { display: none !important; }
    .head-actions { gap: 6px; }
    .lang button { padding: 6px 7px; }
    .logo img { height: 28px; }
    section { padding: 48px 0; }
    .phone { width: 36%; right: -4px; }
    .toc { columns: 1; }
    .site-foot .cols { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .head-actions .btn.primary.when-out { display: none !important; }   /* the hero has it, right below */
    .site-head .wrap { gap: 10px; }
}
