
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --navy: #1c2f6e;
    --navy-2: #28408e;
    --purple-1: #a98cf0;
    --purple-2: #7c4fe0;
    --red-1: #a3264f;
    --red-2: #2c2c6e;
    --bg-page: #dde3f0;
    --white: #ffffff;
    --ink: #232840;
    --ink-soft: #6b7290;
    --bubble-bot: #f6f6f7;
    --bubble-user: #dfe9ff;
    --accent-green: #17b26a;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-soft: 0 10px 30px rgba(28, 47, 110, 0.10);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", Roboto, Arial, "Helvetica Neue", sans-serif;
    background: var(--bg-page);
    color: var(--ink);
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 10%, rgba(255, 255, 255, .5), transparent 40%),
        repeating-linear-gradient(120deg, rgba(255, 255, 255, .35) 0px, rgba(255, 255, 255, .35) 1px, transparent 1px, transparent 90px);
}

button {
    font-family: inherit;
    cursor: pointer;
}

a {
    color: inherit;
}

/* ============ HEADER / TOPBAR ============ */
.topbar {
    background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-2) 100%);
    color: #fff;
}

.topbar__inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.brand__logo {
    display: block;
    width: 108px;
    height: auto;
}

.brand__badge {
    font-size: 9px;
    letter-spacing: 2px;
    color: #b9c2e8;
    font-weight: 600;
}

.topbar__tagline {
    font-size: 12.5px;
    line-height: 1.35;
    color: #dfe4f7;
    max-width: 175px;
    flex-shrink: 0;
    border-left: 1px solid rgba(255, 255, 255, .18);
    padding-left: 18px;
}

.topbar__actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pill-btn {
    background: #fff;
    color: var(--navy);
    border: none;
    border-radius: 30px;
    padding: 8px 18px 8px 14px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.25;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    white-space: nowrap;
    transition: transform .15s ease, box-shadow .15s ease;
}

.pill-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.pill-btn__icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--navy-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pill-btn__icon--play {
    background: #e8384f;
}

.topbar__online {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(120deg, var(--red-1), var(--red-2));
    padding: 8px 20px;
    border-radius: 30px;
    flex-shrink: 0;
}

.online__icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
}

.online__text {
    font-size: 12px;
    line-height: 1.3;
    font-weight: 600;
}

.topbar__phone {
    flex-shrink: 0;
    text-align: right;
}

.phone__hours {
    font-size: 10.5px;
    color: #c3cbec;
}

.phone__number {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: .3px;
}

.phone__callback {
    font-size: 11px;
    text-decoration: underline;
    color: #b9c2e8;
    display: inline-block;
    margin-top: 1px;
}

.phone__callback:hover {
    color: #fff;
}

/* ============ PAGE / HERO ============ */
.page__inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

.hero-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.hero-banner {
    flex: 1;
    background: linear-gradient(100deg, var(--purple-1), var(--purple-2) 75%);
    border-radius: var(--radius-lg);
    padding: 26px 30px;
    text-align: center;
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.hero-banner h1 {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .5px;
    margin-bottom: 6px;
}

.hero-banner p {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #f1ecff;
}

.mascot {
    flex-shrink: 0;
    width: 150px;
    margin-top: -14px;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .15));
}

/* ============ FEATURE STRIP ============ */
.feature-strip {
    background: #fff;
    border-radius: var(--radius-lg);
    margin-top: 14px;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    box-shadow: var(--shadow-soft);
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
}

.feature svg {
    flex-shrink: 0;
}

/* ============ CHAT CARD ============ */
.chat-card {
    background: #f4f6fb;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 26px 26px 30px;
    box-shadow: var(--shadow-soft);
    min-height: 200px;
}

.chat-log {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 900px;
}

/* --- generic row --- */
.msg-row {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    animation: fadeUp .35s ease both;
}

.msg-row.user {
    justify-content: flex-end;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: url("/images/theme/avatar.png") no-repeat center/cover;
    font-size: 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    flex-shrink: 0;
}

.msg-col {
    display: flex;
    flex-direction: column;
    max-width: 74%;
}

.msg-row.user .msg-col {
    align-items: flex-end;
}

.msg-time {
    font-size: 11px;
    color: var(--ink-soft);
    margin-bottom: 4px;
    padding-left: 2px;
}

.msg-row.user .msg-time {
    padding-left: 0;
    padding-right: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.bubble {
    background: var(--bubble-bot);
    color: var(--ink);
    padding: 12px 16px;
    border-radius: 4px 16px 16px 16px;
    font-size: max(min(17px, 1.5vw), 14px);
    line-height: 1.5;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .02);
    filter: drop-shadow(0px 3px 2.5px rgba(185, 191, 215, 0.35));
}

.msg-row.user .bubble {
    background: var(--bubble-user);
    border-radius: 16px 4px 16px 16px;
}

.check {
    display: inline-flex;
    color: #7c93e6;
}

/* typing indicator */
.typing-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}

.typing-text {
    font-size: 13px;
    color: var(--ink-soft);
    display: flex;
    align-items: center;
    gap: 6px;
}

.typing-dots {
    display: inline-flex;
    gap: 3px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--ink-soft);
    animation: blink 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: .2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes blink {

    0%,
    80%,
    100% {
        opacity: .25;
    }

    40% {
        opacity: 1;
    }
}

/* ============ OPTIONS: CARDS ============ */
.options-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 14px;
    max-width: 900px;
    animation: fadeUp .35s ease both;
}

.opt-card {
    border: 2px solid transparent;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    transition: border-color .15s ease, transform .15s ease;
    display: flex;
    flex-direction: column;
}

.opt-card:hover {
    transform: translateY(-2px);
}

.opt-card:disabled,
.options-cards.disabled .opt-card {
    cursor: default;
    opacity: .55;
}

.options-cards.disabled .opt-card:hover {
    transform: none;
}

.opt-card.selected {
    border-color: var(--purple-2);
    opacity: 1;
}

.opt-card__head {
    background: var(--navy-2);
    color: #fff;
    font-size: 12.5px;
    font-weight: 700;
    padding: 8px 6px;
}

.opt-card__body {
    padding: 16px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* ============ OPTIONS: PILLS ============ */
.options-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    max-width: 900px;
}

.opt-pill {
    background: #fff;
    border: 1.5px solid #d7ddef;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    transition: all .15s ease;
}

.opt-pill:hover {
    border-color: var(--navy-2);
}

.options-pills.disabled .opt-pill {
    opacity: .45;
    cursor: default;
}

.options-pills.disabled .opt-pill:hover {
    border-color: #d7ddef;
}

.opt-pill.selected {
    background: var(--navy-2);
    border-color: var(--navy-2);
    color: #fff;
    opacity: 1 !important;
}

/* ============ OPTIONS: TEXT INPUT ============ */
.options-text {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    max-width: 420px;
}

.text-input {
    flex: 1;
    border: 1.5px solid #d7ddef;
    border-radius: 30px;
    padding: 11px 18px;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    background: #fff;
    transition: border-color .15s ease;
}

.text-input:focus {
    border-color: var(--navy-2);
}

.text-input.error {
    border-color: #e8384f;
}

.text-input:disabled {
    opacity: .6;
}

.text-send {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: var(--navy-2);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, transform .15s ease;
}

.text-send:hover {
    background: var(--navy);
    transform: translateY(-1px);
}

.text-send:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}

.options-text.disabled .text-send {
    opacity: .6;
}

/* ============ CONTACT FORM ============ */
.contact-form {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 22px 24px 24px;
    margin-top: 14px;
    max-width: 420px;
    box-shadow: 0 4px 18px rgba(28, 47, 110, .08);
}

.form-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
    display: block;
}

.form-field {
    margin-bottom: 16px;
}

.form-input {
    width: 100%;
    border: 1.5px solid #dfe3f0;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color .15s ease;
}

.form-input:focus {
    border-color: var(--navy-2);
}

.form-input.error {
    border-color: #e8384f;
}

.phone-wrap {
    display: flex;
    align-items: center;
    border: 1.5px solid #dfe3f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .15s ease;
}

.phone-wrap:focus-within {
    border-color: var(--navy-2);
}

.phone-wrap.error {
    border-color: #e8384f;
}

.phone-flag {
    padding: 0 10px;
    font-size: 16px;
    border-right: 1px solid #dfe3f0;
    display: flex;
    align-items: center;
    height: 42px;
}

.phone-wrap input {
    border: none;
    outline: none;
    padding: 11px 12px;
    font-size: 14px;
    flex: 1;
    width: 100%;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: var(--ink-soft);
    line-height: 1.4;
    margin-bottom: 18px;
}

.form-check input {
    margin-top: 2px;
    flex-shrink: 0;
}

.form-check a {
    color: var(--navy-2);
    text-decoration: underline;
}

.form-submit {
    width: 100%;
    background: var(--navy-2);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px;
    font-size: 14.5px;
    font-weight: 700;
    transition: background .15s ease, transform .15s ease;
}

.form-submit:hover {
    background: var(--navy);
    transform: translateY(-1px);
}

.form-submit:disabled {
    opacity: .6;
    cursor: default;
    transform: none;
}

.form-success {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent-green);
}

.form-success svg {
    flex-shrink: 0;
}

@keyframes chatFormAppear {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Класс для плавного появления формы */
.rsform.js-chat-form {
    display: none;
    /* Скрыто по умолчанию */
    margin-top: 15px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f7;
}

.rsform.js-chat-form.is-visible {
    display: block;
    animation: chatFormAppear 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Скрытие поля с данными опроса */
.rsform-block-usermessage {
    display: none !important;
}

/* Косметика для формы внутри чата */
.rsform.js-chat-formm .form-control {
    border-radius: 10px;
    border: 1px solid #dce1e8;
    padding: 10px 14px;
}

.rsform.js-chat-form .btn-primary {
    background-color: #28408e;
    border-color: #28408e;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.rsform.js-chat-form .btn-primary:hover {
    background-color: #1d3270;
    transform: translateY(-1px);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
    .topbar__inner {
        flex-wrap: wrap;
    }

    .topbar__tagline {
        border-left: none;
        padding-left: 0;
    }

    .topbar__online {
        margin-left: 0;
    }

    .topbar__phone {
        text-align: left;
        margin-left: auto;
    }

    .hero-row {
        flex-direction: column;
        align-items: center;
    }

    .mascot {
        margin-top: 4px;
    }

    .options-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .topbar__inner {
        padding: 12px 16px;
        gap: 12px;
    }

    .topbar__actions {
        order: 3;
        width: 100%;
    }

    .pill-btn {
        flex: 1;
        justify-content: center;
    }

    .page__inner {
        padding: 18px 12px 40px;
    }

    .hero-banner h1 {
        font-size: 21px;
    }

    .hero-banner p {
        font-size: 13px;
    }

    .feature-strip {
        padding: 16px;
    }

    .feature {
        width: 45%;
        font-size: 12px;
    }

    .options-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .msg-col {
        max-width: 85%;
    }

    .chat-card {
        padding: 18px 14px 24px;
    }

    .contact-form {
        max-width: 100%;
    }

    .mascot {
        display: none;
    }
}

@media (max-width: 420px) {
    .options-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .opt-card__body svg {
        width: 30px;
        height: 30px;
    }
}