/* =========================================
   INH - Đánh giá trải nghiệm website
   Nền trắng, viền xanh lá theo màu chủ đạo của web
   Đặt ở góc dưới bên trái để không đè chatbot / nút lên đầu trang
========================================= */

.inh-fb {
    --fb-green: var(--primary, #08265B);
    --fb-green-dark: #061A42;
    --fb-green-soft: #EDF3FA;
    --fb-text: var(--text, #222222);
    --fb-muted: var(--muted, #666666);
    --fb-star: var(--secondary, #D4A134);

    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 10005;
    font-family: inherit;
    color: var(--fb-text);
}

.inh-fb[hidden] {
    display: none;
}

.inh-fb *,
.inh-fb *::before,
.inh-fb *::after {
    box-sizing: border-box;
}

/* ---------- Nút nhỏ ---------- */

.inh-fb__open {
    background: #ffffff;
    color: var(--fb-green);
    border: 2px solid var(--fb-green);
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(8, 38, 91, 0.18);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.inh-fb__open:hover,
.inh-fb__open:focus-visible {
    background: var(--fb-green);
    color: #ffffff;
}

/* ---------- Bảng đánh giá ---------- */

.inh-fb__panel {
    display: none;
    width: min(420px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: #ffffff;
    border: 2px solid var(--fb-green);
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
}

/* Khi mở: hiện giữa màn hình, nền phía sau mờ đi */
.inh-fb.is-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.inh-fb.is-open .inh-fb__panel {
    display: block;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: inh-fb-pop 0.22s ease-out;
}

@keyframes inh-fb-pop {
    from {
        opacity: 0;
        transform: translate(-50%, -46%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.inh-fb.is-open .inh-fb__open {
    display: none;
}

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

.inh-fb__title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--fb-text);
}

.inh-fb__close {
    background: none;
    border: 0;
    padding: 0 6px;
    font-size: 24px;
    line-height: 1;
    color: var(--fb-muted);
    cursor: pointer;
}

.inh-fb__close:hover {
    color: var(--fb-green);
}

/* ---------- Chọn kiểu: biểu tượng / sao ---------- */

.inh-fb__tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.inh-fb__tabs button {
    flex: 1;
    background: #ffffff;
    color: var(--fb-text);
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 8px;
    padding: 6px;
    font-size: 13px;
    cursor: pointer;
}

.inh-fb__tabs button[aria-pressed="true"] {
    background: var(--fb-green-soft);
    border-color: var(--fb-green);
    color: var(--fb-green-dark);
    font-weight: 600;
}

/* ---------- Thang điểm ---------- */

.inh-fb__scale {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    margin-bottom: 12px;
}

.inh-fb__scale button {
    flex: 1;
    background: #ffffff;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 10px;
    padding: 8px 0;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    filter: grayscale(1);
    opacity: 0.65;
    transition: transform 0.12s ease, opacity 0.12s ease, border-color 0.12s ease;
}

.inh-fb__scale button:hover {
    opacity: 1;
}

.inh-fb__scale button[aria-checked="true"] {
    filter: none;
    opacity: 1;
    transform: scale(1.1);
    border-color: var(--fb-green);
    background: var(--fb-green-soft);
}

/* Kiểu sao */
.inh-fb__scale.is-stars button {
    filter: none;
    opacity: 1;
    transform: none;
    color: var(--fb-star);
    font-size: 24px;
    background: #ffffff;
    border-color: var(--border, #e5e5e5);
}

.inh-fb__scale.is-stars button:hover {
    border-color: var(--fb-green);
}

/* ---------- Ô nhận xét ---------- */

.inh-fb__text {
    display: block;
    width: 100%;
    min-height: 72px;
    resize: vertical;
    margin: 0 0 10px;
    padding: 9px;
    font: inherit;
    font-size: 14px;
    color: var(--fb-text);
    background: #ffffff;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 8px;
}

.inh-fb__text:focus {
    outline: none;
    border-color: var(--fb-green);
    box-shadow: 0 0 0 2px rgba(8, 38, 91, 0.15);
}

/* Ô chống spam */
.inh-fb__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- Nút gửi ---------- */

.inh-fb__send {
    display: block;
    width: 100%;
    background: var(--fb-green);
    color: #ffffff;
    border: 2px solid var(--fb-green);
    border-radius: 8px;
    padding: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.inh-fb__send:hover:not(:disabled) {
    background: var(--fb-green-dark);
    border-color: var(--fb-green-dark);
}

.inh-fb__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.inh-fb__msg {
    margin: 8px 0 0;
    min-height: 1em;
    font-size: 13px;
    color: var(--fb-muted);
}

.inh-fb__msg.is-error {
    color: #c0392b;
}

.inh-fb__msg.is-ok {
    color: var(--fb-green-dark);
    font-weight: 600;
}

/* ---------- Truy cập bàn phím ---------- */

.inh-fb button:focus-visible,
.inh-fb__text:focus-visible {
    outline: 2px solid var(--fb-green);
    outline-offset: 2px;
}

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

@media (prefers-reduced-motion: reduce) {
    .inh-fb.is-open .inh-fb__panel {
        animation: none;
    }

    .inh-fb__scale button,
    .inh-fb__open,
    .inh-fb__send {
        transition: none;
    }
}

/* Nút đóng / Xóa: chuyển sang màu đỏ khi rê chuột */
.inh-fb__close {
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 6px;
}

.inh-fb__close:hover,
.inh-fb__close:focus-visible {
    color: #ffffff !important;
    background-color: #e53935 !important;
}

/* 2 nút chọn Biểu tượng / Sao: hover màu xanh */
.inh-fb__tabs button {
    transition: all 0.2s ease;
}

.inh-fb__tabs button:hover {
    background: var(--fb-green-soft);
    border-color: var(--fb-green);
    color: var(--fb-green-dark);
}