/* Лендинг «Трачу» — отдельный файл, чтобы не трогать style.css приложения.
   Токены те же, что в дизайне «Индиго». */

:root {
    --indigo: #2f3c94;
    --accent: #3949ab;
    --coral: #FB6F5B;
    --ink: #23264a;
    --muted: #5f6379;
    --bg: #eef0f8;
    --line: #dfe3f2;
}

* { box-sizing: border-box; margin: 0; }

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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--ink);
    background: #fff;
    line-height: 1.55;
    -webkit-text-size-adjust: 100%;
}

img, video { max-width: 100%; display: block; }
a { color: var(--accent); }

.wrap {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Шапка ---------- */
.topbar {
    background: var(--indigo);
    color: #fff;
}
.topbar .wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    padding-bottom: 16px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
}
.brand svg { width: 30px; height: 30px; }
.brand .tagline {
    font-size: 13px;
    font-weight: 400;
    opacity: .75;
}
.topbar .login-link {
    margin-left: auto;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 40px;
}
.topbar .login-link:hover { background: rgba(255, 255, 255, .12); }

/* ---------- Hero ---------- */
.hero {
    background: linear-gradient(160deg, #2f3c94 0%, #3d49ad 100%);
    color: #fff;
    padding: 56px 0 64px;
    text-align: center;
}
.hero h1 {
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: -.5px;
    max-width: 16ch;
    margin: 0 auto 18px;
}
.hero .lead {
    font-size: 19px;
    max-width: 46ch;
    margin: 0 auto 28px;
    color: #dfe3fb;
}
.cta-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    border-radius: 40px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn-primary {
    background: #fff;
    color: var(--indigo);
}
.btn-primary:hover { background: #eef0f8; }
.btn-ghost {
    color: #fff;
    border-color: rgba(255, 255, 255, .5);
}
.btn-ghost:hover { background: rgba(255, 255, 255, .12); }
.hero .note {
    margin-top: 18px;
    font-size: 14px;
    color: #c9cff2;
}

/* ---------- Общие секции ---------- */
section { padding: 56px 0; }
section.tinted { background: var(--bg); }
h2 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -.3px;
}
.section-lead {
    text-align: center;
    color: var(--muted);
    max-width: 52ch;
    margin: 0 auto 36px;
}

/* ---------- Как это работает ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.step {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px 22px;
}
.step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: var(--indigo);
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 15px; }
.step .phrase {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
}

/* ---------- Интерактивное демо ---------- */
.demo-section { overflow: hidden; }
.pwa-demo {
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(280px, 390px);
    justify-content: center;
    align-items: center;
    gap: clamp(38px, 7vw, 92px);
    margin-top: 8px;
}
.pwa-demo__stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 654px;
}
.pwa-demo__stage::before {
    content: '';
    position: absolute;
    width: 116%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(57, 73, 171, .18), rgba(57, 73, 171, 0) 68%);
}
.phone {
    position: relative;
    z-index: 1;
    width: 318px;
    padding: 8px;
    border-radius: 48px;
    background: linear-gradient(145deg, #393a42, #0c0d11 48%, #343640);
    box-shadow: 0 32px 70px rgba(30, 33, 74, .28), inset 0 0 0 1px rgba(255, 255, 255, .22);
}
.phone__side { position: absolute; width: 3px; background: #17181d; border-radius: 3px; }
.phone__side--left { height: 74px; left: -3px; top: 118px; }
.phone__side--right { height: 96px; right: -3px; top: 148px; }
.phone__screen {
    position: relative;
    height: 636px;
    overflow: hidden;
    border-radius: 41px;
    background: #f4f5fa;
}
.phone__island {
    position: absolute;
    z-index: 5;
    top: 10px;
    left: 50%;
    width: 88px;
    height: 24px;
    border-radius: 20px;
    background: #090a0c;
    transform: translateX(-50%);
}
.phone__status {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 22px;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.phone__indicators { display: flex; gap: 4px; font-size: 12px; }
.phone__home {
    position: absolute;
    z-index: 7;
    bottom: 6px;
    left: 50%;
    width: 104px;
    height: 4px;
    border-radius: 4px;
    background: #17181d;
    transform: translateX(-50%);
}
.demo-app { height: 100%; color: #23264a; font-size: 12px; }
.demo-app__header {
    height: 170px;
    padding: 42px 14px 34px;
    border-radius: 0 0 24px 24px;
    background: linear-gradient(150deg, #2f3c94, #4755b5);
    color: #fff;
}
.demo-app__top { display: flex; align-items: center; justify-content: space-between; }
.demo-app__brand { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; }
.demo-app__mark { display: block; width: 22px; height: 22px; flex-shrink: 0; }
.demo-app__brand small { color: #aab6ff; font-size: 8px; font-weight: 500; align-self: end; padding-bottom: 2px; }
.demo-app__user { display: flex; align-items: center; gap: 5px; color: #fff; font-size: 8px; }
.demo-app__user span { display: flex; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 20px; background: rgba(255,255,255,.14); font-weight: 600; }
.demo-app__user > i { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: rgba(255,255,255,.14); font-size: 13px; }
.demo-app__month-nav { display: grid; grid-template-columns: 28px 1fr 28px 28px; align-items: center; gap: 5px; margin-top: 11px; text-align: center; }
.demo-app__month-nav > span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.14); font-size: 11px; }
.demo-app__month-nav small { display: block; color: #aab6ff; font-size: 8px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.demo-app__total { display: block; font-size: 25px; line-height: 1.1; letter-spacing: -.5px; transition: transform .35s, color .35s; }
.demo-app__body { position: relative; padding: 0 13px 18px; transform: translateY(-22px); }
.demo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.demo-stats > div { min-width: 0; padding: 8px 7px; border-radius: 11px; background: #fff; box-shadow: 0 4px 12px rgba(35,38,74,.12); }
.demo-stats span, .demo-expense small { display: block; color: #7a7e96; font-size: 9px; }
.demo-stats span { display: flex; align-items: center; gap: 3px; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; font-size: 7px; font-weight: 700; letter-spacing: .03em; }
.demo-stats span i { flex-shrink: 0; color: #3949ab; font-size: 8px; }
.demo-stats strong { display: block; margin-top: 1px; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.demo-form { position: relative; margin-top: 8px; padding: 10px; border-radius: 15px; background: #fff; box-shadow: 0 4px 14px rgba(35,38,74,.07); }
.demo-payment { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; color: #565a75; text-align: center; font-size: 8px; }
.demo-payment span { padding: 5px 2px; border-radius: 30px; background: #f1f2f8; }
.demo-payment .is-active { background: #e4e8ff; color: #2f3c94; font-weight: 700; }
.demo-voice-field, .demo-fields { display: flex; align-items: center; gap: 7px; margin-top: 8px; }
.demo-voice-field { position: relative; }
.demo-description, .demo-amount, .demo-fields > span:last-child { height: 33px; border: 1px solid #dfe2ec; border-radius: 9px; display: flex; align-items: center; padding: 0 10px; color: #9396aa; overflow: hidden; white-space: nowrap; }
.demo-description { flex: 1; }
.demo-mic { position: relative; display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 33px; padding: 0; border: 0; border-radius: 9px; background: #3949ab; color: #fff; font-size: 15px; box-shadow: none; }
.demo-mic::before, .demo-mic::after { content: ''; position: absolute; inset: -1px; border: 2px solid rgba(57,73,171,.4); border-radius: inherit; opacity: 0; }
.demo-transcript { display: none; align-items: center; gap: 4px; min-height: 28px; margin-top: 7px; padding: 6px 9px; border-radius: 9px; background: #eef0ff; color: #3949ab; font-size: 9px; font-weight: 600; }
.demo-transcript i { width: 1px; height: 12px; background: #3949ab; animation: demo-blink .65s steps(1) infinite; }
.demo-fields > span { flex: 1; }
.demo-category { max-height: 0; width: max-content; max-width: 100%; margin-top: 0; padding: 0 9px; overflow: hidden; border-radius: 30px; background: #f1f2f8; color: #5f6379; font-size: 8px; opacity: 0; transition: max-height .45s, margin .45s, padding .45s, opacity .3s; white-space: nowrap; }
.demo-category b { color: #2f3c94; }
.demo-category i { color: #9aa0bd; }
.demo-add { position: relative; display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; height: 32px; margin-top: 8px; padding: 0; border: 0; border-radius: 10px; background: #3949ab; color: #fff; font: inherit; font-size: 10px; font-weight: 700; box-shadow: none; transition: transform .15s, background .2s; }
.demo-history-title { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px 5px; }
.demo-history-title strong { font-size: 12px; }
.demo-history-title span { display: flex; gap: 4px; }
.demo-history-title span b { padding: 4px 7px; border-radius: 20px; background: #e4e8ff; color: #2f3c94; font-size: 7px; }
.demo-history-title span b i { margin-right: 2px; }
.demo-date-group { display: flex; justify-content: space-between; padding: 1px 7px 4px; color: #5f6379; font-size: 8px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.demo-date-group strong { color: #5f6379; font-size: 8px; letter-spacing: 0; }
.demo-expenses { overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(35,38,74,.06); }
.demo-expense { display: grid; grid-template-columns: 29px minmax(0, 1fr) auto; gap: 7px; align-items: center; min-width: 0; padding: 7px 9px; border-bottom: 1px solid #f1f2f8; background: #fff; }
.demo-expense:last-child { border-bottom: 0; }
.demo-expense > span:nth-child(2) { min-width: 0; }
.demo-expense strong { font-size: 9px; white-space: nowrap; }
.demo-expense__icon { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; font-size: 14px; }
.demo-expense__icon--coffee { background: #f3e5f5; }
.demo-expense__icon--cyan { background: #e0f7fa; }
.demo-expense__right { display: flex; align-items: center; gap: 4px; color: #9aa0bd; font-size: 9px; }
.demo-expense__right strong { color: #23264a; }
.demo-expense small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-expense--new { max-height: 0; padding-top: 0; padding-bottom: 0; transform: translateY(-7px) scale(.96); opacity: 0; overflow: hidden; transition: max-height .55s cubic-bezier(.2,.8,.2,1), padding .55s, transform .55s, opacity .35s; }
.demo-tap { position: absolute; z-index: 4; width: 21px; height: 21px; border: 2px solid rgba(251,111,91,.65); border-radius: 50%; opacity: 0; pointer-events: none; }
.demo-tap--mic { right: 6px; top: 6px; }
.demo-tap--add { right: 46%; bottom: 15px; }
.pwa-demo__caption { max-width: 390px; }
.pwa-demo__caption-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pwa-demo__eyebrow { color: #3949ab; font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pwa-demo__replay { display: inline-flex; align-items: center; gap: 5px; width: auto; padding: 7px 11px; border: 1px solid #d8dbee; border-radius: 30px; background: rgba(255,255,255,.72); color: #555b7b; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.pwa-demo__replay:hover { background: #fff; color: #3949ab; }
.pwa-demo__caption h3 { margin: 16px 0 10px; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.5px; }
.pwa-demo__caption > p:not(.visually-hidden) { min-height: 3.1em; color: var(--muted); font-size: 16px; }
.pwa-demo__timeline { height: 5px; margin-top: 24px; overflow: hidden; border-radius: 8px; background: #d9dce9; }
.pwa-demo__timeline span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3949ab, #fb6f5b); }
.pwa-demo.is-running .pwa-demo__timeline span { animation: demo-progress 15s linear forwards; }
.pwa-demo[data-stage="tap-mic"] .demo-tap--mic, .pwa-demo[data-stage="tap-add"] .demo-tap--add { animation: demo-tap .85s ease-out; }
.pwa-demo[data-stage="listening"] .demo-mic, .pwa-demo[data-stage="transcript"] .demo-mic { background: #fb6f5b; }
.pwa-demo[data-stage="listening"] .demo-mic::before, .pwa-demo[data-stage="listening"] .demo-mic::after, .pwa-demo[data-stage="transcript"] .demo-mic::before, .pwa-demo[data-stage="transcript"] .demo-mic::after { animation: demo-pulse 1.2s ease-out infinite; }
.pwa-demo[data-stage="listening"] .demo-mic::after, .pwa-demo[data-stage="transcript"] .demo-mic::after { animation-delay: .55s; }
.pwa-demo[data-stage="transcript"] .demo-transcript { display: flex; }
.pwa-demo[data-stage="filled"] .demo-description, .pwa-demo[data-stage="tap-add"] .demo-description, .pwa-demo[data-stage="added"] .demo-description, .pwa-demo[data-stage="final"] .demo-description,
.pwa-demo[data-stage="filled"] .demo-amount, .pwa-demo[data-stage="tap-add"] .demo-amount, .pwa-demo[data-stage="added"] .demo-amount, .pwa-demo[data-stage="final"] .demo-amount { border-color: #bbc2ec; color: #23264a; font-weight: 700; }
.pwa-demo[data-stage="filled"] .demo-category, .pwa-demo[data-stage="tap-add"] .demo-category, .pwa-demo[data-stage="added"] .demo-category, .pwa-demo[data-stage="final"] .demo-category { max-height: 25px; margin-top: 6px; padding: 5px 9px; opacity: 1; }
.pwa-demo[data-stage="tap-add"] .demo-add { transform: scale(.97); background: #26347f; }
.pwa-demo[data-stage="added"] .demo-expense--new, .pwa-demo[data-stage="final"] .demo-expense--new { max-height: 52px; padding-top: 7px; padding-bottom: 7px; transform: none; opacity: 1; }
.pwa-demo[data-stage="added"] .demo-app__total, .pwa-demo[data-stage="final"] .demo-app__total { color: #ffdad3; transform: scale(1.03); transform-origin: left; }
@keyframes demo-progress { to { width: 100%; } }
@keyframes demo-tap { 0% { opacity: 0; transform: scale(.4); } 35% { opacity: 1; } 100% { opacity: 0; transform: scale(2.2); } }
@keyframes demo-pulse { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.75); } }
@keyframes demo-blink { 50% { opacity: 0; } }

/* ---------- Скриншоты ---------- */
.shots {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: start;
}
.shot img {
    width: 100%;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 28px rgba(35, 38, 74, .12);
}
.shot p {
    margin-top: 12px;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}

/* ---------- Возможности ---------- */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.feature {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
}
.feature i {
    font-size: 26px;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--muted); font-size: 15px; }

/* ---------- Приватность ---------- */
.privacy-card {
    background: #fff;
    border: 1px solid var(--line);
    border-left: 4px solid var(--coral);
    border-radius: 16px;
    padding: 26px 28px;
    max-width: 760px;
    margin: 0 auto;
}
.privacy-card h2 { text-align: left; margin-bottom: 14px; }
.privacy-card ul { margin: 0; padding-left: 22px; color: var(--muted); }
.privacy-card li { margin-bottom: 8px; }

/* ---------- Финальный призыв ---------- */
.final {
    background: var(--indigo);
    color: #fff;
    text-align: center;
}
.final h2 { color: #fff; }
.final .section-lead { color: #c9cff2; }

/* ---------- Частые вопросы ---------- */
.faq {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
.faq__item {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 22px;
}
.faq__item h3 { font-size: 17px; margin-bottom: 8px; }
.faq__item p { color: var(--muted); font-size: 15px; }

/* ---------- Футер ---------- */
footer {
    padding: 28px 0 40px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}
footer a { color: var(--muted); }
footer p { margin-bottom: 6px; }

/* ---------- Мобильные ---------- */
@media (max-width: 760px) {
    .hero { padding: 40px 0 48px; }
    .hero h1 { font-size: 30px; }
    .hero .lead { font-size: 17px; }
    section { padding: 40px 0; }
    h2 { font-size: 24px; }
    .steps, .features, .shots, .faq { grid-template-columns: 1fr; }
    .brand .tagline { display: none; }
    .btn { width: 100%; justify-content: center; }
    .cta-row { flex-direction: column; }
    .pwa-demo { grid-template-columns: 1fr; gap: 22px; }
    .pwa-demo__stage { min-height: 602px; }
    .phone { width: 290px; border-radius: 44px; }
    .phone__screen { height: 580px; border-radius: 37px; }
    .demo-app { transform: scale(.91); transform-origin: top center; width: 110%; height: 110%; margin-left: -5%; }
    .pwa-demo__caption { max-width: 440px; margin: 0 auto; text-align: center; }
    .pwa-demo__caption-head { justify-content: center; flex-wrap: wrap; gap: 9px 14px; }
    .pwa-demo__caption h3 { margin-top: 12px; font-size: 24px; }
    .pwa-demo__caption > p:not(.visually-hidden) { min-height: 0; font-size: 15px; }
    .pwa-demo__timeline { margin-top: 18px; }
}

@media (max-width: 360px) {
    .phone { width: 278px; }
    .phone__screen { height: 556px; }
    .pwa-demo__stage { min-height: 576px; }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-demo *, .pwa-demo *::before, .pwa-demo *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
