/* ============================================================
 * Chatland — стили лендинга (сгенерировано конструктором)
 * Секции «из конструктора» содержат значения из настроек стиля;
 * их можно править вручную — до следующего republish.
 * ============================================================ */

:root {
    --chatland-accent: #0a457eFF;
    --chatland-chat-bg: #F6F6F6E5;
    --chatland-font: 'Arial', Arial, sans-serif;
}

/* ---------- База ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: Arial, ui-sans-serif, system-ui, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ---------- Фон страницы (из конструктора) ---------- */

.bg-wrapper {
    background-image: url('../assets/bg-webp.webp');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    line-height: initial;

}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100%;
    pointer-events: none;
    background-color: #00000000;
}

/* ---------- Шапка ---------- */

#site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    display: flex;
    height: 103px;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: animated-header 1s;
    background-color: #FFFFFF;
}

.header-content {
    display: flex;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    width: 140px;
    height: 80px;
    margin-right: 8px;
    flex-shrink: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.header-logo-text {
    position: relative;
    margin-left: 12px;
    padding-left: 20px;
    border-left: 1px solid #9ca3af;
    color: #767C82;
    font-size: 16px;
    font-style: normal;
    font-family: ChangAnunitype-Regular-woff;
    font-weight: normal;
}

.header-contact {
    position: relative;
    width: 100%;
    max-width: 270px;
    text-align: right;
    color: #767C82;
    font-size: 14px;
    font-family: ChangAnunitype-Regular-woff;
    font-weight: normal;
}

.header-contact a {
    font-size: 18px;
    padding-bottom: 10px;
    font-weight: bold;
}

.header-contact p {
    margin-top: 6px;
}

/* ---------- Контент ---------- */

.content {
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    max-width: 830px;
}

.main-content {
    margin-top: 103px;
    height: 100%;
    padding-top: 64px;
}

#chat-main-title {
    position: relative;
    text-align: center;
    white-space: pre-line;
    animation: animated-title 1s;
    color: #000000FF;
    font-size: 36px;
    font-style: normal;
    font-family: ChangAnunitype-Bold-woff;
    font-weight: normal;
}

#chat-main-subtitle {
    position: relative;
    margin-top: 24px;
    margin-bottom: 20px;
    text-align: center;
    animation: animated-title 1s;
    color: #484F54;
    font-size: 22px;
    font-style: normal;
    font-family: ChangAnunitype-Regular-woff;
    font-weight: normal;
}

/* ---------- Инфо-иконки текстов конструктора ---------- */

[data-info-text] {
    opacity: 0.6;
    cursor: pointer;
    transition: opacity 0.15s;
}

[data-info-text]:hover {
    opacity: 1;
}

/* ---------- Преимущества ---------- */

#animated-container-outer {
    margin-top: 16px;
    animation: animated-container 1.5s;
}

.advantages-block {
    position: relative;
    margin-top: 32px;
    display: flex;
    height: fit-content;
    align-items: center;
    justify-content: center;
    border-radius: 30px 30px 0 0;
    padding: 24px 16px;
    color: #ffffff;
    font-size: 16px;
    font-family: ChangAnunitype-Regular-woff;
    padding-top: 24px;
    border-radius: 30px;
    padding-bottom: 24px;
    background-color: #0a457eFF;
    /* Нижних скруглений нет: блок примыкает к чату (правила выше не перекрывают) */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.advantages-row {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 0;
}

.advantage-item {
    width: 33.333%;
    padding-right: 8px;
}

.advantage-inner {
    display: flex;
    height: 100%;
    align-items: center;
    gap: 8px;
}

.advantage-icon {
    flex-shrink: 0;
}

.advantage-icon img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
}

/* ---------- Уведомление ---------- */

.notification {
    display: flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    text-align: center;
    background-color: #e5e7eb;
    color: #FFFFFF;
    height: 36px;
    font-size: 16px;
    font-style: normal;
    font-family: ChangAnunitype-Regular-woff;
    font-weight: normal;
    background-color: rgba(255, 149, 48, 1);
}

/* Якорь абсолютной инфо-иконки — текст уведомления, не вся плашка */
.notification-inner {
    position: relative;
}

/* ---------- Юридические блоки ---------- */

.legal-block {
    position: fixed;
    bottom: 12px;
    left: 20px;
    width: 300px;
    color: #4b5563;
    font-size: 12px;
}

.legal-info {
    color: #4C5865;
    font-size: 10px;
}

.policy-link a {
    text-decoration: underline;
    color: #4C5865;
    font-size: 10px;
}

.copyright {
    position: fixed;
    right: 20px;
    bottom: 12px;
    width: 200px;
    text-align: right;
    line-height: 1.25;
    color: #4b5563;
    font-size: 12px;
    color: #4C5865;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .legal-block,
    .copyright {
        display: none;
    }
}

/* ---------- Адаптив обвязки ---------- */

@media (max-width: 768px) {
    .header-logo-text {
        display: none;
    }

    .header-contact {
        font-size: 0.8rem;
    }

    .advantage-item {
        width: 100%;
    }

    .advantages-block {
        border-radius: 24px 24px 0 0;
    }
}

@media (max-width: 640px) {
    .advantages-block {
        display: none;
    }
}

/* ============================================================
 * Чат
 * ============================================================ */

#container {
    position: relative;
    min-height: 100vh;
    padding: 56px 32px 80px 56px;
    background-color: var(--chatland-chat-bg);
    overflow-x: hidden;
}

@media (min-width: 640px) {
    #container {
        padding-left: 112px;
    }
}

#container-avatar {
    position: absolute;
    top: 56px;
    left: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    animation: avatar-from-left 1s forwards;
    animation-delay: 2s;
    transform: translateX(-100px);
    opacity: 0;
}

@media (min-width: 640px) {
    #container-avatar {
        left: 32px;
        width: 60px;
        height: 60px;
    }
}

#chatland-container-inner {
    position: relative;
    font-family: var(--chatland-font);
    font-size: 16px;
    line-height: 1.5;
}

/* Появление сообщений: консультант выезжает слева, ответ — справа */
.chatland-message-wrapper {
    position: relative;
    margin-bottom: 20px;
    opacity: 0;
    transform: translateX(-10%);
    transition: all 0.7s;
}

.chatland-answer-wrapper {
    transform: translateX(10%);
}

.chatland-message-wrapper.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Сообщение консультанта */
.chatland-message {
    padding: 16px;
    border-radius: 15px;
    border-top-left-radius: 0;
    width: fit-content;
    max-width: 36rem;
    background-color: #ffffff;
    box-shadow: 0 3px 10px rgba(38, 36, 60, 0.07);
    color: #1f2937;
    white-space: pre-line;
}

/* Ответ посетителя */
.chatland-answer-wrapper {
    display: flex;
    justify-content: flex-end;
}

.chatland-answer {
    padding: 16px 20px;
    max-width: 75%;
    background-color: var(--chatland-accent);
    color: #ffffff;
    border-radius: 12px;
    border-bottom-right-radius: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ---------- Карточки опций ---------- */

.chatland-options-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chatland-options-group-before {
    margin-bottom: 0;
}

.chatland-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-width: 36rem;
}

@media (max-width: 640px) {
    .chatland-options-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.chatland-option-card {
    position: relative;
    padding: 16px;
    border-radius: 16px;
    border: 2px solid transparent;
    width: 100%;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chatland-option-card:hover {
    box-shadow: #ccc 2px 2px 7px;
}

.chatland-option-card.selected {
    border-color: var(--chatland-accent);
    opacity: 1;
}

.chatland-option-card.unselected,
.chatland-option-min.unselected {
    opacity: 0.75;
}

.chatland-check-icon {
    position: absolute;
    top: -8px;
    right: -10px;
    width: 28px;
    height: 28px;
    padding: 6px;
    border-radius: 50%;
    color: #ffffff;
    background-color: var(--chatland-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.chatland-check-icon svg {
    width: 16px;
    height: 16px;
    fill: #ffffff;
}

.chatland-check-icon-min {
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 4px;
}

.chatland-check-icon-min svg {
    width: 12px;
    height: 12px;
}

.chatland-option-badge {
    position: absolute;
    top: -10px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 9999px;
    background-color: var(--chatland-accent);
    color: #ffffff;
    font-size: 11px;
}

.chatland-option-img {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}

.chatland-option-img img {
    max-height: 100px;
    margin-bottom: 8px;
}

.chatland-option-color {
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    width: 75%;
    height: 48px;
    min-height: 48px;
}

.chatland-option-label {
    display: inline-block;
    font-weight: 700;
    font-size: 18px;
    color: #343434;
}

/* Tiptap оборачивает тексты в <p> — инлайним их, чтобы инфо-иконка
   оставалась в строке текста (приём landing_4: label/desc/benefit p → inline) */
.chatland-option-label p,
.chatland-option-desc p,
.chatland-option-benefit p,
.chatland-option-badge p {
    display: inline;
    margin: 0;
}

/* У сообщений абзацы сохраняем — инлайнится только последний, к нему липнет иконка
   (last-of-type: после appendChild иконки последним ребёнком становится span) */
.chatland-message p:last-of-type {
    display: inline;
}

.chatland-option-desc {
    font-size: 15px;
    line-height: 148%;
    color: #828282;
}

.chatland-option-benefit {
    margin-top: 4px;
    color: #343434;
    font-size: 18px;
    width: fit-content;
    border-bottom: 1px solid var(--chatland-accent);
}

/* Выгода внутри описания (<prof> из конструктора) */
.chatland-profit {
    color: #343434;
    font-size: 18px;
    line-height: 2.25rem;
    border-bottom: 1px solid var(--chatland-accent);
    position: relative;
}

/* Компактный список опций (listType=min) */
.chatland-options-min {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chatland-option-min {
    display: flex;
    overflow: hidden;
    position: relative;
    padding: 6px 12px;
    min-height: 48px;
    gap: 8px;
    align-items: center;
    border-radius: 8px;
    border: 2px solid transparent;
    width: 100%;
    max-width: 240px;
    background-color: #ffffff;
    cursor: pointer;
}

.chatland-option-min:hover {
    box-shadow: #ccc 2px 2px 7px;
}

.chatland-option-min.selected {
    border-color: var(--chatland-accent);
    opacity: 1;
}

.chatland-option-min-color {
    width: 28px;
    height: 28px;
    flex: none;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.chatland-option-min span {
    font-weight: 700;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* ---------- Чекбокс-группа ---------- */

.chatland-checkbox-group {
    padding: 16px 20px;
    max-width: 500px;
    width: fit-content;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.chatland-checkbox-group-before {
    margin-bottom: 12px;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.chatland-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.chatland-checkbox-label:hover {
    opacity: 0.8;
}

.chatland-checkbox-label.selected .chatland-checkbox-text-label {
    color: var(--chatland-accent);
}

.chatland-checkbox {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--chatland-accent);
    cursor: pointer;
}

.chatland-checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chatland-checkbox-text-label {
    font-size: 15px;
    font-weight: 500;
    color: #1f2937;
}

.chatland-checkbox-text-desc {
    font-size: 13px;
    color: #6b7280;
}

/* ---------- Общая кнопка ---------- */

.chatland-btn {
    display: flex;
    padding: 12px 20px;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 9999px;
    background-color: var(--chatland-accent);
    color: #ffffff;
    font-size: 15px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.chatland-btn:hover {
    box-shadow: #777 2px 2px 7px;
}

.chatland-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.chatland-checkbox-btn {
    margin-top: 12px;
}

/* ---------- Текстовый ввод ---------- */

.chatland-text-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    max-width: 480px;
}

.chatland-text-input-before {
    margin-bottom: 12px;
}

.chatland-text-input-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    font-size: 15px;
    outline-color: var(--chatland-accent);
}

.chatland-text-input-btn {
    padding: 12px 14px;
}

/* ---------- Форма заявки ---------- */

.chatland-order-form {
    display: flex;
    margin-top: 20px;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 360px;
}

.chatland-order-form-input {
    max-width: 100%;
    width: 308px;
    padding: 20px 16px 20px 20px;
    border: 1px solid #c0c4ff;
    border-radius: 9999px;
    background-color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    outline-color: var(--chatland-accent);
}

.chatland-order-form-phone {
    display: flex;
    position: relative;
    align-items: center;
}

.chatland-order-form-phone-prefix {
    position: absolute;
    left: 8px;
    font-weight: 600;
}

.chatland-order-form-phone-input {
    width: 300px;
    padding-left: 28px;
}

.chatland-order-form-error {
    color: #dc2626;
    font-size: 12px;
    padding-left: 8px;
}

.chatland-order-form-error:empty {
    display: none;
}

.chatland-order-form-submit {
    padding: 16px;
    width: 100%;
    max-width: 16rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.chatland-order-form-confirm {
    margin-top: 6px;
    padding-left: 8px;
    font-size: 0.8rem;
    color: #6b7280;
}

.chatland-confirm-btns {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.chatland-confirm-btns .chatland-btn {
    padding: 6px 14px;
    font-size: 13px;
}

.chatland-confirm-no {
    background-color: #6b7280;
}

.chatland-order-form-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
}

.chatland-order-form-consent input {
    margin-top: 2px;
    accent-color: var(--chatland-accent);
}

/* ---------- Иконки-подсказки и модалки ---------- */

.chatland-info-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-left: 4px;
    color: #5a6060;
    opacity: 0.8;
    cursor: pointer;
    transition: color 0.15s;
}

.chatland-info-icon:hover {
    color: #000000;
    opacity: 1;
}

/* На цветной плашке бейджа иконка белая, как текст бейджа (landing_4:
   .chatland-badge-info-icon — #fff, opacity .8→1, размер 14) */
.chatland-option-badge .chatland-info-icon {
    color: #ffffff;
    opacity: 0.8;
}

.chatland-option-badge .chatland-info-icon:hover {
    color: #ffffff;
    opacity: 1;
}

.chatland-option-badge .chatland-info-icon svg {
    width: 14px;
    height: 14px;
}

.chatland-info-modal,
.chatland-lead-modal {
    width: 100%;
    max-width: 480px;
    padding: 32px;
    border: none;
    border-radius: 24px;
    margin: auto;
    text-align: center;
    font-family: var(--chatland-font);
}

.chatland-info-modal::backdrop,
.chatland-lead-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.chatland-info-modal-close,
.chatland-lead-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    outline: none;
}

.chatland-lead-modal-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
    color: var(--chatland-accent);
}

.chatland-lead-modal-redirect {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    border-radius: 9999px;
    background-color: var(--chatland-accent);
    color: #ffffff;
}

/* ---------- Модалка заявки (клик по преимуществам/уведомлению) ---------- */

.chatland-chat-modal {
    width: 100%;
    max-width: 570px;
    padding: 0;
    border: none;
    border-radius: 24px;
    margin: auto;
    background-color: #e5e7eb;
    font-family: var(--chatland-font);
    overflow: visible;
}

.chatland-chat-modal::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.chatland-chat-modal[open] {
    animation: chat-modal-slide-up 0.7s ease-in-out;
}

.chatland-chat-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    border: none;
    background: none;
    font-size: 32px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    outline: none;
}

.chatland-chat-modal-close:hover {
    color: #000000;
}

.chatland-chat-modal-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 16px;
    border-radius: 24px 24px 0 0;
    background-color: #ffffff;
}

.chatland-chat-modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.chatland-chat-modal-name {
    font-weight: 700;
    font-size: 18px;
}

.chatland-chat-modal-position {
    font-size: 14px;
    color: #6b7280;
}

.chatland-chat-modal-body {
    padding: 28px 28px 48px;
}

.chatland-chat-modal-body .chatland-message {
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .chatland-chat-modal {
        margin-bottom: 0;
        border-radius: 24px 24px 0 0;
    }

    .chatland-chat-modal-header {
        border-radius: 24px 24px 0 0;
    }
}

@keyframes chat-modal-slide-up {
    from {
        opacity: 0;
        scale: 0.7;
        transform: translateY(70px);
    }

    to {
        opacity: 1;
        scale: 1;
        transform: translateY(0);
    }
}

/* ---------- Cookie-плашка ---------- */

.chatland-cookie {
    position: fixed;
    right: 32px;
    bottom: -128px;
    z-index: 101;
    width: 370px;
    padding: 12px;
    border-radius: 16px;
    background-color: #1d1d1bcc;
    color: #ffffff;
    font-size: 14px;
    opacity: 0.25;
    transition: all 0.3s;
}

.chatland-cookie.visible {
    bottom: 32px;
    opacity: 1;
}

.chatland-cookie a {
    text-decoration: underline;
}

.chatland-cookie-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    background: none;
    font-size: 24px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
}

.chatland-cookie-close:hover {
    color: #9ca3af;
}

.chatland-cookie-accept-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.chatland-cookie-accept {
    padding: 14px 64px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .chatland-cookie {
        display: none;
    }
}

/* ---------- Индикатор набора ---------- */

#consultant-typing {
    position: fixed;
    z-index: 101;
    bottom: 0;
    float: left;
    padding: 0 8px;
    border-radius: 4px 4px 0 0;
    opacity: 0;
    transform: scale(0);
    transform-origin: left center;
}

#consultant-typing.visible {
    animation: consultant-typing 1s forwards;
}

.jumping-dots span {
    position: relative;
    bottom: 0;
    animation: jump 1s infinite;
}

.jumping-dots .dot-1 { animation-delay: 200ms; }
.jumping-dots .dot-2 { animation-delay: 400ms; }
.jumping-dots .dot-3 { animation-delay: 600ms; }

/* ---------- Адаптив чата ---------- */

@media (max-width: 768px) {
    #chat-main-title {
        font-size: 28px;
    }

    #chat-main-subtitle {
        font-size: 18px;
    }
}

/* ---------- Анимации ---------- */

@keyframes jump {
    0% { bottom: 0; }
    20% { bottom: 5px; }
    40% { bottom: 0; }
}

@keyframes consultant-typing {
    0% { opacity: 0; transform: scale(0); }
    100% { opacity: 0.7; transform: scale(1); }
}

@keyframes animated-header {
    0% { transform: translateY(-300px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes animated-title {
    0% { transform: translateY(300px); opacity: 0.5; scale: 0.9; }
    100% { transform: translateY(0); opacity: 1; scale: 1; }
}

@keyframes animated-container {
    0% { transform: translateY(300px); opacity: 0.5; scale: 0.9; }
    100% { transform: translateY(0); opacity: 1; scale: 1; }
}

@keyframes avatar-from-left {
    0% { transform: translateX(-100px); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}
