/* Thành phần tăng tương tác — dùng biến màu sẵn có trong style.css */
:root {
    --tsh-card: rgba(23, 56, 78, .72);
    --tsh-border: rgba(255, 255, 255, .10);
    --tsh-muted: #a9bfcd;
    --tsh-radius: 14px;
}

.tsh-eyebrow {
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
}
.tsh-muted { color: var(--tsh-muted); }
.tsh-section-title {
    font-size: 26px;
    margin: 0 0 6px;
    color: var(--white-color);
}

/* ---------- Hero trang chủ ---------- */
.tsh-hero {
    position: relative;
    padding: 56px 0 48px;
    background:
        radial-gradient(ellipse at 15% 0%, rgba(255, 112, 16, .18), transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(23, 56, 78, .9), transparent 60%),
        var(--dark-color1);
    border-bottom: 1px solid var(--tsh-border);
}
.tsh-hero__title {
    font-size: 44px;
    line-height: 1.15;
    color: var(--white-color);
    margin: 0 0 16px;
}
.tsh-hero__lead { font-size: 17px; line-height: 1.6; color: var(--primary-color); }
.tsh-hero__points { list-style: none; padding: 0; margin: 18px 0 0; }
.tsh-hero__points li { margin: 6px 0; color: var(--tsh-muted); }
.tsh-hero__form {
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 28px 24px 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.tsh-hero__form .as_sign_form ul { margin: 0; }
.tsh-last-result {
    display: inline-block;
    margin-top: 16px;
    color: var(--secondary-color);
    border-bottom: 1px dashed var(--secondary-color);
}
.tsh-last-result[hidden] { display: none; }

.tsh-form__note {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--tsh-muted);
    text-align: center;
}
.tsh-form .tracuu-btn[disabled] { opacity: .7; cursor: progress; }

/* ---------- Nút tra cứu nổi ---------- */
.tsh-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1040;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 10px 25px rgba(255, 112, 16, .45);
    cursor: pointer;
    animation: tsh-pulse 2.6s ease-in-out infinite;
}
.tsh-fab img { filter: brightness(0) invert(1); }
.tsh-fab:hover, .tsh-fab:focus-visible { transform: translateY(-2px); outline: none; }
@keyframes tsh-pulse {
    0%, 100% { box-shadow: 0 10px 25px rgba(255, 112, 16, .45); }
    50% { box-shadow: 0 10px 35px rgba(255, 112, 16, .75); }
}
@media (prefers-reduced-motion: reduce) { .tsh-fab { animation: none; } }

/* ---------- Thông báo lỗi ---------- */
.tsh-alert {
    max-width: 720px;
    margin: 0 auto 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background: rgba(220, 53, 69, .15);
    border: 1px solid rgba(220, 53, 69, .5);
    color: #ffd6da;
    text-align: center;
}

/* ---------- Trang kết quả ---------- */
.tsh-profile {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
    align-items: center;
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 28px;
    position: relative;
    z-index: 1;
}
.tsh-profile__name { font-size: 34px; color: var(--white-color); margin: 0 0 6px; }
.tsh-profile__meta { color: var(--tsh-muted); margin: 0 0 16px; }
.tsh-profile__summary {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 112, 16, .10);
    border: 1px solid rgba(255, 112, 16, .35);
}
.tsh-profile__icon {
    flex: 0 0 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}
.tsh-profile__icon img { width: 26px; height: 26px; filter: brightness(0) invert(1); }

.tsh-share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.tsh-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--tsh-border);
    background: rgba(255, 255, 255, .06);
    color: var(--white-color) !important;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.tsh-share__btn:hover { background: rgba(255, 255, 255, .12); }
.tsh-share__btn--primary { background: var(--secondary-color); border-color: var(--secondary-color); }
.tsh-share__btn--primary:hover { background: #ff8533; }

.tsh-overview, .tsh-details, .tsh-again, .tsh-related { margin-top: 40px; position: relative; z-index: 1; }

.tsh-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.tsh-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    transition: border-color .2s, transform .2s;
}
.tsh-chip:hover { border-color: var(--secondary-color); transform: translateY(-2px); }
.tsh-chip.is-main { border-color: var(--secondary-color); background: rgba(255, 112, 16, .12); }
.tsh-chip__num {
    flex: 0 0 auto;
    min-width: 44px;
    height: 44px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--dark-color1);
    color: var(--secondary-color);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tsh-chip__label { font-size: 14px; line-height: 1.3; color: var(--white-color); text-transform: capitalize; }

.tsh-detail {
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    margin-bottom: 12px;
    scroll-margin-top: 90px;
    overflow: hidden;
}
.tsh-detail[open] { border-color: rgba(255, 112, 16, .55); }
.tsh-detail summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    cursor: pointer;
}
.tsh-detail summary::-webkit-details-marker { display: none; }
.tsh-detail__num {
    flex: 0 0 auto;
    min-width: 52px;
    height: 52px;
    padding: 0 6px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tsh-detail__title { flex: 1; display: flex; flex-direction: column; }
.tsh-detail__title strong { color: var(--white-color); font-size: 18px; }
.tsh-detail__title small { color: var(--tsh-muted); font-size: 13px; }
.tsh-detail__chev {
    width: 12px;
    height: 12px;
    border-right: 2px solid var(--tsh-muted);
    border-bottom: 2px solid var(--tsh-muted);
    transform: rotate(45deg);
    transition: transform .2s;
}
.tsh-detail[open] .tsh-detail__chev { transform: rotate(-135deg); }
.tsh-detail__body {
    padding: 4px 22px 22px;
    line-height: 1.75;
    color: var(--primary-color);
    border-top: 1px solid var(--tsh-border);
    padding-top: 18px;
}

.tsh-inline-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin: 16px 0;
    padding: 16px 18px;
    border-radius: var(--tsh-radius);
    border: 1px dashed var(--secondary-color);
    background: rgba(255, 112, 16, .08);
    color: var(--white-color);
}
.tsh-inline-cta span { flex: 1 1 260px; }

.tsh-card {
    display: block;
    border-radius: var(--tsh-radius);
    overflow: hidden;
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    margin-bottom: 16px;
    height: calc(100% - 16px);
    transition: transform .2s, border-color .2s;
}
.tsh-card:hover { transform: translateY(-3px); border-color: var(--secondary-color); }
.tsh-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--dark-color2); }
.tsh-card__title { display: block; padding: 12px 14px; color: var(--white-color); font-weight: 600; line-height: 1.4; }

/* ---------- Mobile ---------- */
@media (max-width: 991px) {
    .tsh-hero { padding: 32px 0; }
    .tsh-hero__title { font-size: 32px; }
    .tsh-hero__form { margin-top: 22px; }
    .tsh-profile { grid-template-columns: 1fr; text-align: center; padding: 22px 16px; }
    .tsh-profile__summary { text-align: left; }
    .tsh-share { justify-content: center; }
}
@media (max-width: 575px) {
    .tsh-hero__title { font-size: 28px; }
    .tsh-hero__lead { font-size: 16px; }
    .tsh-hero__form { padding: 20px 14px 12px; }
    .tsh-section-title { font-size: 22px; }
    .tsh-profile__name { font-size: 26px; }
    .tsh-chips { grid-template-columns: repeat(2, 1fr); }
    .tsh-fab {
        left: 16px;
        right: 16px;
        bottom: 12px;
        justify-content: center;
        padding: 14px;
    }
    .tsh-detail__body { padding: 16px 14px 18px; }
    body { padding-bottom: 72px; }
}

/* Header gọn trên điện thoại: ẩn dải liên hệ, nhường chỗ cho form tra cứu */
@media (max-width: 767px) {
    .as_header_wrapper .as_info_detail { display: none !important; }
}

/* Form trong hero: bỏ lớp nền/padding lồng nhau của .as_sign_form */
.tsh-hero__form .as_sign_form { padding: 0; background: transparent; }
@media (max-width: 575px) {
    .tsh-hero__form .as_sign_form ul li { padding: 0; width: 100%; }
    .tsh-hero__form .tracuu-btn { width: 100%; }
}

/* Ẩn nút nổi khi một form tra cứu đang hiển thị trên màn hình */
.tsh-fab.is-hidden { opacity: 0; pointer-events: none; transform: translateY(20px); }
.tsh-fab { transition: opacity .25s, transform .25s; }

/* Form hero: lưới 2 cột, ô nhập đủ rộng */
.tsh-hero__form .as_sign_form ul {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.tsh-hero__form .as_sign_form ul li {
    width: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
}
.tsh-hero__form .as_sign_form ul li:first-child,
.tsh-hero__form .as_sign_form ul li:last-child { grid-column: 1 / -1; }
.tsh-hero__form .tracuu-btn { width: 100%; }
@media (max-width: 575px) {
    .tsh-hero__form .as_sign_form ul { grid-template-columns: 1fr; }
}
.tsh-hero__form .as_input_feild,
.tsh-hero__form .as_input_feild .form-control { width: 100% !important; max-width: none; }
.tsh-hero__form .as_sign_form ul li { max-width: none !important; }

/* =========================================================
   Xem độ hợp nhau
   ========================================================= */
.tsh-amp { color: var(--secondary-color); }
.tsh-lead { font-size: 17px; max-width: 720px; margin: 0 auto 24px; }
.tsh-box {
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 22px;
}
.tsh-share--center { justify-content: center; margin: 24px 0 8px; }

.tsh-compat-people {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
}
.tsh-person {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 22px 16px;
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
}
.tsh-person__num {
    min-width: 64px;
    height: 64px;
    padding: 0 8px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.tsh-person__name { font-size: 20px; color: var(--white-color); }
.tsh-person__trait { color: var(--white-color); font-weight: 600; margin-top: 6px; }
.tsh-person__group {
    margin-top: 6px;
    font-size: 13px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid var(--tsh-border);
    color: var(--tsh-muted);
}

.tsh-score { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.tsh-score__ring {
    --deg: calc(var(--score) * 3.6deg);
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary-color) var(--deg), rgba(255, 255, 255, .08) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(255, 112, 16, .35);
}
.tsh-score__ring::before {
    content: '';
    position: absolute;
}
.tsh-score__value {
    width: 138px;
    height: 138px;
    border-radius: 50%;
    background: var(--dark-color1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: var(--white-color);
}
.tsh-score__value small { font-size: 22px; margin-left: 2px; color: var(--secondary-color); }
.tsh-score__verdict { font-size: 18px; font-weight: 600; color: var(--white-color); text-align: center; }

.tsh-aspects { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 16px; }
.tsh-aspect {
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 16px 18px;
}
.tsh-aspect__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tsh-aspect__head strong { color: var(--white-color); font-size: 17px; }
.tsh-aspect__nums { color: var(--secondary-color); font-weight: 700; }
.tsh-badge {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
.tsh-badge--great { background: rgba(46, 204, 113, .18); color: #7ee2a8; }
.tsh-badge--same { background: rgba(155, 89, 182, .22); color: #d7b4ea; }
.tsh-badge--good { background: rgba(255, 112, 16, .18); color: #ffb27d; }
.tsh-badge--challenge { background: rgba(255, 255, 255, .08); color: var(--tsh-muted); }
.tsh-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-bottom: 8px; }
.tsh-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff9a3d, var(--secondary-color)); }

.tsh-tips { padding-left: 0; list-style: none; margin: 12px 0 0; }
.tsh-tips li { position: relative; padding: 8px 0 8px 28px; border-bottom: 1px solid var(--tsh-border); }
.tsh-tips li:last-child { border-bottom: 0; }
.tsh-tips li::before { content: '✦'; position: absolute; left: 4px; color: var(--secondary-color); }
.tsh-chips--wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tsh-chips--wide .tsh-chip__label { text-transform: none; }
.tsh-disclaimer { margin: 28px 0 0; font-size: 13px; color: var(--tsh-muted); text-align: center; font-style: italic; }

.tsh-compat-form-wrap { margin-top: 48px; }
.tsh-compat-result + .tsh-compat-form-wrap { border-top: 1px solid var(--tsh-border); padding-top: 40px; }
.tsh-compat-form-wrap:first-child { margin-top: 0; }
.tsh-compat-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
    max-width: 860px;
    margin: 0 auto 20px;
}
.tsh-compat-card {
    background: var(--tsh-card);
    border: 1px solid var(--tsh-border);
    border-radius: var(--tsh-radius);
    padding: 18px 20px 20px;
    margin: 0;
    min-width: 0;
}
.tsh-compat-card legend {
    float: none;
    width: auto;
    font-size: 15px;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin: 0 0 6px;
    padding: 0;
}
.tsh-label { display: block; font-size: 14px; color: var(--tsh-muted); margin: 10px 0 6px; }
.tsh-compat-card .form-control { width: 100%; }
.tsh-compat-heart {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 25px rgba(255, 112, 16, .5);
}

@media (max-width: 767px) {
    .tsh-compat-people { grid-template-columns: 1fr 1fr; }
    .tsh-compat-people .tsh-score { grid-column: 1 / -1; order: -1; }
    .tsh-aspects { grid-template-columns: 1fr; }
    .tsh-compat-grid { grid-template-columns: 1fr; }
    .tsh-compat-heart { margin: -6px auto; width: 42px; height: 42px; font-size: 18px; }
    .tsh-person { padding: 16px 10px; }
    .tsh-person__name { font-size: 17px; }
    .tsh-score__ring { width: 150px; height: 150px; }
    .tsh-score__value { width: 120px; height: 120px; font-size: 42px; }
}
.tsh-hero__compat { margin-top: 18px; }

/* Form chỉ còn 2 ô (họ tên, ngày sinh): xếp cạnh nhau, nút bấm full chiều ngang */
.tsh-hero__form .as_sign_form ul li:first-child { grid-column: auto; }
@media (max-width: 575px) {
    .tsh-hero__form .as_sign_form ul li:first-child { grid-column: 1 / -1; }
}
