/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --clr-primary: #e63946;
    --clr-primary-dark: #c1121f;
    --clr-dark: #1d1d1f;
    --clr-grey: #f5f6f8;
    --clr-text: #2b2b2b;
    --clr-muted: #6b7280;
    --clr-white: #fff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 30px rgba(0, 0, 0, .08);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, .14);
    --transition: .25s ease;
    --container: 1240px;
    --font: 'Manrope', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--clr-text);
    background: var(--clr-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, button { font-family: inherit; }

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

.text-red { color: var(--clr-primary); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    white-space: nowrap;
}
.btn--primary { background: var(--clr-primary); color: #fff; }
.btn--primary:hover { background: var(--clr-primary-dark); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(230, 57, 70, .3); }
.btn--outline { border: 2px solid var(--clr-primary); color: var(--clr-primary); background: transparent; }
.btn--outline:hover { background: var(--clr-primary); color: #fff; }
.btn--lg { padding: 16px 36px; font-size: 17px; }
.btn--sm { padding: 8px 18px; font-size: 14px; }

/* ===== HEADER ===== */
.header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.header__inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 20px; padding-block: 14px;
}
.header__logo img { height: 40px; width: auto; }
.header__nav { display: flex; align-items: center; gap: 20px; }
.header__phone { font-weight: 700; font-size: 17px; white-space: nowrap; }
.header__burger { display: none; flex-direction: column; gap: 5px; }
.header__burger span { width: 26px; height: 2px; background: var(--clr-dark); transition: var(--transition); }

/* Выпадашка городов */
.header__city-wrap { position: relative; }
.header__city {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--clr-muted);
    font-size: 14px;
    padding: 6px 0;
    border-bottom: 1px dashed currentColor;
    transition: var(--transition);
}
.header__city:hover { color: var(--clr-primary); border-bottom-color: var(--clr-primary); }
.header__city-arrow { transition: transform var(--transition); }
.header__city[aria-expanded="true"] .header__city-arrow { transform: rotate(180deg); }

.header__city-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 150;
    width: 340px;
    max-height: 460px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: dropdownIn .18s ease;
}
.header__city-dropdown[hidden] { display: none !important; }

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
}

.header__city-search { padding: 12px; border-bottom: 1px solid #eee; }
.header__city-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e5e7eb;
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}
.header__city-input:focus { border-color: var(--clr-primary); }
.header__city-list { overflow-y: auto; padding: 8px 0; }
.header__city-empty { padding: 20px; text-align: center; color: var(--clr-muted); font-size: 14px; }

.cities-group { padding: 4px 0; }
.cities-group__letter {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 800;
    color: var(--clr-primary);
    text-transform: uppercase;
    background: var(--clr-grey);
}
.cities-group__list { list-style: none; padding: 0; margin: 0; }
.cities-group__link { display: block; padding: 8px 16px; font-size: 14px; color: var(--clr-text); transition: var(--transition); }
.cities-group__link:hover { background: var(--clr-grey); color: var(--clr-primary); }
.cities-group__link.is-active { color: var(--clr-primary); font-weight: 700; background: rgba(230, 57, 70, .06); }

/* ===== HERO ===== */
.hero {
    background: linear-gradient(135deg, #eef4fd 0%, #f9fbff 100%);
    padding: 60px 0 80px;
    overflow: hidden;
}
.hero__inner { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero__title { font-size: clamp(28px, 4vw, 52px); line-height: 1.15; font-weight: 800; margin-bottom: 16px; }
.hero__title .text-red { display: block; }
.hero__subtitle { font-size: 20px; color: var(--clr-muted); margin-bottom: 24px; }
.hero__list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-bottom: 32px; }
.hero__list li { position: relative; padding-left: 28px; font-size: 16px; }
.hero__list li::before {
    content: '✓'; position: absolute; left: 0; top: 0;
    color: var(--clr-primary); font-weight: 800;
}

/* ===== SECTIONS ===== */
.section { padding: 60px 0; }
.section--grey { background: var(--clr-grey); }
.section__title {
    font-size: clamp(24px, 3vw, 36px); font-weight: 800;
    margin-bottom: 40px; line-height: 1.2;
}
.section__lead { max-width: 900px; color: var(--clr-muted); margin-bottom: 40px; font-size: 16px; }

/* ===== PRODUCTS ===== */
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.product-card {
    display: grid; grid-template-columns: 1fr 1fr;
    background: var(--clr-white); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: var(--transition);
}
.product-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.product-card__img {
    min-height: 200px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #fff;
    border-radius: var(--radius) 0 0 var(--radius);
}
.product-card__body { padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.product-card__title { font-size: 20px; font-weight: 700; }
.product-card__text { color: var(--clr-muted); font-size: 14px; flex-grow: 1; }
.product-card__body .btn { align-self: flex-start; }

/* ===== ADVANTAGES ===== */
.advantages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.adv-card {
    background: var(--clr-white); border-radius: var(--radius);
    padding: 28px 20px; text-align: center;
    box-shadow: var(--shadow); transition: var(--transition);
}
.adv-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.adv-card__icon { margin: 0 auto 16px; width: 50px; height: 50px; }
.adv-card__icon img { width: 100%; height: 100%; object-fit: contain; }
.adv-card__title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.adv-card__text { font-size: 13px; color: var(--clr-muted); }

/* ===== CALCULATOR & FORMS ===== */
.calc {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
    background: var(--clr-white); border-radius: var(--radius);
    padding: 40px; box-shadow: var(--shadow);
}
.calc-field { margin-bottom: 32px; }
.calc-field label { display: block; font-weight: 600; margin-bottom: 8px; }
.calc-field__value { font-size: 22px; font-weight: 800; color: var(--clr-primary); margin-bottom: 12px; }
.calc-field__result { font-size: 22px; font-weight: 800; color: var(--clr-dark); }
.calc-field input[type="range"] {
    width: 100%; height: 6px; border-radius: 3px; appearance: none;
    background: #e5e7eb; outline: none; cursor: pointer;
}
.calc-field input[type="range"]::-webkit-slider-thumb {
    appearance: none; width: 22px; height: 22px;
    border-radius: 50%; background: var(--clr-primary);
    border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    cursor: pointer;
}
.calc-field input[type="range"]::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--clr-primary); border: 3px solid #fff; cursor: pointer;
}
.calc-field__range { display: flex; justify-content: space-between; font-size: 12px; color: var(--clr-muted); margin-top: 6px; }
.calc__form h3 { margin-bottom: 20px; font-size: 22px; }

.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-field input {
    width: 100%; padding: 12px 16px; font-size: 15px;
    border: 2px solid #e5e7eb; border-radius: var(--radius-sm);
    transition: var(--transition); background: var(--clr-white);
}
.form-field input:focus {
    outline: none; border-color: var(--clr-primary);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, .1);
}
.personal-data { font-size: 12px; color: var(--clr-muted); margin: 12px 0; line-height: 1.5; }
.personal-data a { color: var(--clr-primary); text-decoration: underline; }

/* ===== EXAMPLES & REVIEWS ===== */
.examples, .reviews {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}
.example-card, .review-card {
    background: var(--clr-white); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow);
}
.example-card {
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow var(--transition);
    opacity: 0;
    transform: translateY(30px);
}
.example-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.example-card:hover, .review-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

.example-card:nth-child(1) { transition-delay: 0.0s, 0.0s, 0.0s; }
.example-card:nth-child(2) { transition-delay: 0.1s, 0.1s, 0.0s; }
.example-card:nth-child(3) { transition-delay: 0.2s, 0.2s, 0.0s; }
.example-card:nth-child(4) { transition-delay: 0.3s, 0.3s, 0.0s; }
.example-card:nth-child(5) { transition-delay: 0.4s, 0.4s, 0.0s; }
.example-card:nth-child(6) { transition-delay: 0.5s, 0.5s, 0.0s; }

.example-card__img {
    height: 160px; background-size: contain;
    background-repeat: no-repeat; background-position: center;
    margin-bottom: 16px;
}
.example-card h3 { font-size: 18px; margin-bottom: 16px; }
.example-card__list { display: flex; flex-direction: column; gap: 8px; }
.example-card__list div { display: flex; justify-content: space-between; font-size: 14px; }
.example-card__list dt { color: var(--clr-muted); }
.example-card__list dd { font-weight: 700; }
.review-card__text { font-size: 15px; line-height: 1.7; color: var(--clr-text); margin-bottom: 16px; }
.review-card__author { font-weight: 700; color: var(--clr-primary); }

/* ===== FAQ ===== */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq__item {
    background: var(--clr-white); border-radius: var(--radius-sm);
    padding: 20px 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
}
.faq__item summary {
    cursor: pointer; font-weight: 700; font-size: 16px;
    list-style: none; display: flex; justify-content: space-between; align-items: center;
}
.faq__item summary::after {
    content: '+'; font-size: 24px; color: var(--clr-primary);
    transition: var(--transition); line-height: 1;
}
.faq__item[open] summary::after { content: '−'; }
.faq__answer { margin-top: 12px; color: var(--clr-muted); line-height: 1.7; font-size: 15px; }

/* ===== CONTACTS ===== */
.contacts { display: flex; justify-content: flex-start; }
.contacts__info {
    background: var(--clr-white); border-radius: var(--radius);
    padding: 40px; box-shadow: var(--shadow);
    max-width: 520px; width: 100%;
    border-top: 4px solid var(--clr-primary);
}
.contacts__info h3 {
    font-size: 14px; font-weight: 700; margin-bottom: 16px;
    color: var(--clr-muted); text-transform: uppercase; letter-spacing: .5px;
}
.contacts__address {
    font-style: normal; font-size: 22px; font-weight: 700;
    color: var(--clr-dark); margin-bottom: 20px; line-height: 1.4;
}
.contacts__phone {
    display: block; font-size: 24px; font-weight: 800;
    color: var(--clr-primary); margin-bottom: 12px;
    transition: var(--transition);
}
.contacts__phone:hover { color: var(--clr-primary-dark); }
.contacts__work { color: var(--clr-muted); font-size: 15px; margin-bottom: 24px; }

/* ===== FOOTER ===== */
.footer { background: var(--clr-dark); color: #fff; padding: 60px 0 40px; }
.footer__inner { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 40px; }
.footer__logo { filter: brightness(0) invert(1) !important; opacity: 0.6; display: block; }
.footer__phone { display: block; font-size: 22px; font-weight: 800; margin: 20px 0; }
.footer__nav { display: flex; flex-direction: column; gap: 12px; }
.footer__nav a { color: rgba(255, 255, 255, .75); transition: var(--transition); }
.footer__nav a:hover { color: #fff; }
.footer__legal { font-size: 12px; color: rgba(255, 255, 255, .5); margin-top: 20px; line-height: 1.6; }

/* ===== MODAL ===== */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none !important; }
.modal__overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); }
.modal__window {
    position: relative; z-index: 1; background: #fff; border-radius: var(--radius);
    padding: 36px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
    animation: modalIn .3s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px); } }
.modal__close {
    position: absolute; top: 16px; right: 16px;
    width: 36px; height: 36px; border-radius: 50%;
    font-size: 24px; line-height: 1; background: var(--clr-grey);
    display: flex; align-items: center; justify-content: center;
}
.modal__window h2 { font-size: 24px; margin-bottom: 8px; }
.modal__window > p { color: var(--clr-muted); margin-bottom: 20px; }

/* ===== TO TOP ===== */
.to-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--clr-primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; opacity: 0; pointer-events: none;
    transition: var(--transition); box-shadow: var(--shadow);
}
.to-top.visible { opacity: 1; pointer-events: auto; }

/* ===== КВИЗ ===== */
.quiz { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 800px; margin: 0 auto; }
.quiz__progress { height: 6px; background: #e5e7eb; border-radius: 3px; margin-bottom: 24px; overflow: hidden; }
.quiz__bar { height: 100%; width: 33%; background: var(--clr-primary); transition: width 0.3s ease; }
.quiz__step { display: none; text-align: center; }
.quiz__step.is-active { display: block; }
.quiz__step h3 { font-size: 22px; margin-bottom: 20px; }
.quiz__options { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.quiz__opt { padding: 16px 24px; border: 2px solid #e5e7eb; border-radius: 12px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; background: #fff; }
.quiz__opt:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.quiz__sum { font-size: 36px; font-weight: 800; color: var(--clr-primary); margin: 20px 0; }

/* ===== ИНФОГРАФИКА 4 ШАГА ===== */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.step-card { background: #fff; padding: 30px 20px; border-radius: var(--radius); text-align: center; box-shadow: var(--shadow); border-top: 4px solid var(--clr-primary); transition: transform 0.3s; }
.step-card:hover { transform: translateY(-5px); }
.step-card__num { font-size: 40px; font-weight: 800; color: var(--clr-primary); opacity: 0.3; margin-bottom: 10px; }
.step-card h3 { font-size: 18px; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--clr-muted); }

/* ===== ЛЕНТА ОДОБРЕНИЙ ===== */
.live-feed { position: fixed; bottom: 24px; left: 24px; z-index: 99; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.live-feed__item { background: #fff; padding: 16px 20px; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border-left: 4px solid #28a745; display: flex; align-items: center; gap: 12px; animation: slideInLeft 0.5s ease-out; pointer-events: auto; max-width: 300px; }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.live-feed__item.fade-out { animation: fadeOut 0.5s ease-in forwards; }
@keyframes fadeOut { to { transform: translateX(-100%); opacity: 0; } }
.live-feed__sum { color: var(--clr-primary); font-weight: 800; font-size: 15px; }

/* ===== ТЕСТ НА ШАНС ===== */
.test-block { background: #fff; padding: 40px; border-radius: var(--radius); box-shadow: var(--shadow); max-width: 600px; margin: 0 auto; text-align: center; }
.test-block__question { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.test-block__actions { display: flex; gap: 16px; justify-content: center; margin-bottom: 24px; }
.test-block__progress { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-bottom: 24px; }
.test-block__bar { height: 100%; background: var(--clr-primary); transition: width 0.3s; }
.test-block__percent { font-size: 48px; font-weight: 800; color: #28a745; margin: 10px 0 20px; }

/* ===== ТАБЫ ПОГАШЕНИЯ ===== */
.repay-tabs { max-width: 800px; margin: 0 auto; }
.repay-tabs__nav { display: flex; gap: 8px; margin-bottom: 20px; justify-content: center; }
.repay-tabs__btn { padding: 12px 24px; border-radius: 30px; background: #fff; border: 2px solid #e5e7eb; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.repay-tabs__btn.is-active { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }
.repay-tabs__pane { display: none; background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.repay-tabs__pane.is-active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .header__nav { display: none; }
    .header__burger { display: flex; }
    .header__nav.open {
        display: flex; position: absolute; top: 100%; left: 0; right: 0;
        flex-direction: column; background: #fff; padding: 20px;
        box-shadow: var(--shadow); align-items: stretch;
    }
    .hero__inner { grid-template-columns: 1fr; }
    .hero__image { order: -1; max-width: 500px; margin: 0 auto; }
    .products { grid-template-columns: 1fr; }
    .advantages { grid-template-columns: repeat(3, 1fr); }
    .calc { grid-template-columns: 1fr; padding: 24px; }
    .footer__inner { grid-template-columns: 1fr; }
    .steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
    .section { padding: 48px 0; }
    .header__city-dropdown { width: 280px; left: auto; right: 0; }
    .product-card { grid-template-columns: 1fr; }
    .product-card__img { min-height: 200px; border-radius: var(--radius) var(--radius) 0 0; }
    .advantages { grid-template-columns: repeat(2, 1fr); }
    .modal__window { padding: 24px; }
    .contacts__info { padding: 28px 20px; }
    .contacts__address { font-size: 18px; }
    .contacts__phone { font-size: 20px; }
    .steps { grid-template-columns: 1fr; }
    .live-feed { left: 10px; bottom: 10px; right: 10px; }
    .live-feed__item { max-width: 100%; }
    .repay-tabs__nav { flex-wrap: wrap; }
}