/* Отзывы и виджет обратной связи. Стили сайта, отдельный слой. */

/* ---------- Отзывы ---------- */

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.review-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
    background: var(--c-panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.review-card__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.review-card__name {
    font-weight: 600;
    font-size: 14px;
}

.review-card__meta {
    color: var(--c-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.04em;
}

.review-card__stars {
    color: var(--c-gold);
    font-size: 12px;
    letter-spacing: 0.12em;
}

.review-card__text {
    color: var(--c-text-2);
    font-size: 13.5px;
    line-height: 1.6;
    white-space: pre-line;
}

.reviews-cta {
    display: flex;
    justify-content: center;
    margin-top: var(--gap-block);
}

@media (max-width: 960px) {
    .reviews-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Виджет: кнопка и панель ---------- */

.fb {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.fb__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding-inline: 16px;
    border: 1px solid var(--c-line-gold);
    border-radius: 999px;
    background: var(--c-panel-solid);
    color: var(--c-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.fb__toggle:hover {
    border-color: var(--c-gold);
    color: var(--c-gold-2);
}

.fb__toggle svg {
    width: 18px;
    height: 18px;
    color: var(--c-gold);
}

.fb__panel {
    width: min(360px, calc(100vw - 40px));
    padding: 16px;
    border: 1px solid var(--c-line-gold);
    border-radius: var(--radius);
    background: var(--c-panel-solid);
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
    display: none;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.fb__panel.is-open {
    display: flex;
}

.fb__panel.is-view {
    height: min(82vh, 584px);
}

.fb [hidden] {
    display: none !important;
}

.fb__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.fb__title {
    font-family: var(--font-display);
    font-size: 15px;
}

.fb__close {
    width: 28px;
    height: 28px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: transparent;
    color: var(--c-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.fb__actions {
    display: grid;
    gap: 8px;
}

.fb__action {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 11px 12px;
    border: 1px solid var(--c-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--c-text);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}

.fb__action:hover {
    border-color: var(--c-line-gold);
}

.fb__action b {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.fb__action span {
    display: block;
    color: var(--c-muted);
    font-size: 11px;
    margin-top: 2px;
}

.fb__form {
    display: none;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    align-content: start;
}

.fb__form.is-open {
    display: flex;
    flex-direction: column;
}

.fb__field--grow {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.fb__field.fb__field--grow {
    display: flex;
    flex-direction: column;
}

.fb__field--grow textarea {
    flex: 1 1 auto;
    min-height: 90px;
    resize: none;
}

.fb__send--block {
    width: 100%;
    margin-top: auto;
    flex: none;
}

.fb__field {
    display: grid;
    gap: 4px;
}

.fb__field span {
    color: var(--c-muted);
    font-size: 11px;
}

.fb input,
.fb textarea,
.fb select {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: var(--c-bg-soft);
    color: var(--c-text);
    font-family: inherit;
    font-size: 13px;
}

.fb textarea {
    min-height: 90px;
    resize: vertical;
}

.fb input:focus,
.fb textarea:focus,
.fb select:focus {
    outline: none;
    border-color: var(--c-line-gold);
}

.fb__send {
    height: 40px;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--c-gold) 60%, transparent);
    background: linear-gradient(180deg, var(--c-gold-2), var(--c-gold));
    color: #1b1207;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
}

.fb__send:disabled {
    opacity: 0.6;
    cursor: default;
}

.fb__status {
    min-height: 16px;
    color: var(--c-muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.fb__status.is-ok {
    color: var(--c-green);
}

.fb__status.is-err {
    color: var(--c-red);
}

.fb__support {
    display: grid;
    gap: 6px;
    font-size: 12.5px;
}

.fb__support a {
    color: var(--c-gold-2);
}

@media (max-width: 600px) {
    .fb {
        right: 12px;
        bottom: 12px;
    }

    .fb__toggle span {
        display: none;
    }

    .fb__toggle {
        width: 48px;
        height: 48px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }
}

/* ---------- Ссылка-кнопка в футере ---------- */

.footer__link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--c-text-2);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: color 0.2s var(--ease);
}

.footer__link:hover {
    color: var(--c-gold-2);
}

/* ---------- Окно «Контакты» ---------- */

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 20px;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.modal__card {
    position: relative;
    width: min(420px, 100%);
    padding: 20px;
    border: 1px solid var(--c-line-gold);
    border-radius: var(--radius);
    background: var(--c-panel-solid);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
}

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.modal__head h3 {
    font-size: 17px;
}

.modal__close {
    width: 30px;
    height: 30px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: transparent;
    color: var(--c-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.contacts__line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--c-line-soft);
    font-size: 13.5px;
}

.contacts__line span {
    color: var(--c-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contacts__line a {
    color: var(--c-gold-2);
}

.contacts__note {
    margin-top: 14px;
    color: var(--c-muted);
    font-size: 12px;
}

/* ---------- Шапка виджета: 24/7 и онлайн ---------- */

.fb__24 {
    color: var(--c-gold);
    font-weight: 700;
    font-size: 12px;
}

.fb__online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: var(--c-green);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.fb__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--c-green);
    animation: fb-pulse 1.8s ease-out infinite;
}

@keyframes fb-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(69, 214, 160, 0.55);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(69, 214, 160, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(69, 214, 160, 0);
    }
}

/* ---------- AI-чат поддержки ---------- */

.fb__chat {
    display: none;
}

.fb__chat.is-open {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.fb__chat-sub {
    color: var(--c-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.fb__log {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 0;
    overflow-y: auto;
    padding: 2px;
}

.fb__msg {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.5;
    max-width: 92%;
    white-space: pre-wrap;
}

.fb__msg--bot {
    justify-self: start;
    border: 1px solid var(--c-line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--c-text-2);
}

.fb__msg--user {
    justify-self: end;
    border: 1px solid var(--c-line-gold);
    background: color-mix(in srgb, var(--c-gold) 14%, transparent);
    color: var(--c-text);
}

.fb__msg--note {
    justify-self: center;
    color: var(--c-muted);
    font-size: 11px;
    text-align: center;
}

.fb__row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fb__row input,
.fb__row textarea {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.fb__row textarea {
    min-height: 38px;
    max-height: 96px;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
}

.fb__row .fb__send {
    width: 100%;
    height: 38px;
    padding-inline: 14px;
    flex: none;
}

.fb__typing {
    color: var(--c-muted);
    font-size: 11px;
}

.fb__panel > .fb__head,
.fb__panel > .fb__actions,
.fb__panel > .fb__chat-sub,
.fb__panel > .fb__row,
.fb__panel > .fb__typing {
    flex: 0 0 auto;
}

.fb__chat > .fb__log {
    flex: 1 1 auto;
}

/* ---------- Скриншот в сообщении об ошибке ---------- */

.fb__attach {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.fb__attach-btn {
    padding: 7px 10px;
    border: 1px solid var(--c-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--c-text-2);
    font-size: 11.5px;
    cursor: pointer;
}

.fb__attach-btn:hover {
    border-color: var(--c-line-gold);
    color: var(--c-gold-2);
}

.fb__attach-name {
    color: var(--c-muted);
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
}

/* Поле ввода в чате растёт вверх за счёт лога, а не растягивается flex */
.fb__row textarea {
    flex: none;
}

/* Контакты: «онлайн» в один ряд с текстом, у правого края (как значения) */
.contacts__note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.contacts__note .fb__online {
    margin-left: auto;
}
