﻿/* ==========================================
   HTC TOOLS — TRANG RIÊNG
   Dùng chung styles.css của website
   ========================================== */

.tools-page {
    background: #f6f9fc;
}

    .tools-page main {
        min-height: 70vh;
        padding-top: 110px;
    }

    .tools-page #tools {
        margin-top: 0;
    }

    .tools-page #bang-gia {
        scroll-margin-top: 110px;
    }

    /* Tiêu đề đầu trang */

    .tools-page .section-title h1 {
        margin: 16px 0 22px;
        font-family: inherit;
        font-size: clamp(2rem, 4vw, 3.5rem);
        font-weight: 800;
        line-height: 1.16;
        letter-spacing: -0.035em;
    }

    .tools-page .tools-description {
        max-width: 720px;
        margin-right: auto;
        margin-left: auto;
        line-height: 1.8;
    }

    .tools-page .tools-page-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 16px 24px;
        margin-top: 28px;
    }

    .tools-page .tools-account-link {
        font-weight: 600;
        text-underline-offset: 5px;
    }

    /* Menu đang chọn */

    .tools-page nav a[aria-current="page"] {
        font-weight: 800;
        text-decoration: underline;
        text-underline-offset: 7px;
    }

    /* Công cụ */

    .tools-page .tool-grid {
        margin-top: 44px;
    }

        .tools-page .tool-grid article {
            min-width: 0;
        }

        .tools-page .tool-grid details p {
            line-height: 1.75;
        }

    /* Hộp thoại thanh toán */

    .tools-page .plan-dialog {
        box-sizing: border-box;
        width: min(560px, calc(100vw - 32px));
        max-height: 90vh;
        overflow-y: auto;
    }

        .tools-page .plan-dialog::backdrop {
            background: rgba(9, 25, 45, 0.65);
        }

        .tools-page .plan-dialog p {
            line-height: 1.7;
        }

        .tools-page .plan-dialog strong {
            overflow-wrap: anywhere;
        }

    /* QR hiển thị ngay trong hộp thoại */

    .tools-page .payment-qr {
        margin: 18px 0;
        padding: 18px;
        border: 1px solid #dde6f0;
        border-radius: 16px;
        background: #ffffff;
        color: #18324b;
        text-align: center;
    }

        .tools-page .payment-qr img {
            display: block;
            width: min(100%, 360px);
            height: auto;
            margin: 0 auto;
        }

        .tools-page .payment-qr p {
            margin-bottom: 0;
            font-size: 14px;
        }

    /* Giữ đúng trạng thái ẩn của QR và thông báo */

    .tools-page [hidden] {
        display: none !important;
    }

/* Thiết bị di động */

@media (max-width: 640px) {
    .tools-page main {
        padding-top: 90px;
    }

    .tools-page #bang-gia {
        scroll-margin-top: 90px;
    }

    .tools-page .section-title h1 {
        font-size: clamp(1.9rem, 8vw, 2.7rem);
    }

    .tools-page .tools-page-actions {
        flex-direction: column;
        align-items: stretch;
    }

        .tools-page .tools-page-actions a {
            text-align: center;
        }

    .tools-page .plan-dialog {
        max-height: 88vh;
    }

    .tools-page .payment-qr {
        padding: 12px;
    }
}
/* ==========================================
   MENU TÀI KHOẢN TRÊN TRANG TOOLS
   ========================================== */

.tools-page .htc-user-nav {
    position: relative;
    min-width: 0;
}

.tools-page .htc-user-dropdown {
    position: relative;
}

/* Nút tên người dùng */

.tools-page .htc-user-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 270px;
    min-height: 46px;
    margin: 0;
    padding: 8px 13px 8px 8px;
    border: 1px solid #dce5ef;
    border-radius: 999px;
    background: #ffffff;
    color: #173850;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease;
}

    .tools-page .htc-user-trigger:hover {
        border-color: #99bbdc;
        background: #f2f7fc;
    }

    .tools-page .htc-user-trigger:focus-visible {
        outline: 3px solid #9ac9f2;
        outline-offset: 3px;
    }

.tools-page .htc-user-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e7f1fb;
    color: #155d9f;
    font-size: 13px;
    font-weight: 800;
}

.tools-page .htc-user-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tools-page .htc-user-chevron {
    flex: 0 0 16px;
    transition: transform 180ms ease;
}

.tools-page .htc-user-trigger[aria-expanded="true"]
.htc-user-chevron {
    transform: rotate(180deg);
}

/* Bảng thông tin xổ xuống */

.tools-page .htc-user-panel {
    position: absolute;
    z-index: 100;
    top: calc(100% + 12px);
    right: 0;
    width: 310px;
    max-width: calc(100vw - 32px);
    padding: 8px;
    border: 1px solid #e0e8f1;
    border-radius: 16px;
    background: #ffffff;
    color: #173850;
    text-align: left;
    box-shadow: 0 18px 55px rgba(15, 43, 72, 0.16);
}

.tools-page .htc-user-details {
    display: grid;
    gap: 7px;
    padding: 16px 12px 18px;
    border-bottom: 1px solid #e8eef5;
}

.tools-page .htc-user-caption {
    color: #73849a;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.12em;
}

.tools-page #htcUserFullName {
    color: #173850;
    font-size: 16px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.tools-page #htcUserEmail {
    color: #63788f;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

/* Các mục trong bảng */

.tools-page .htc-user-panel .htc-user-account,
.tools-page .htc-user-panel .htc-user-logout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 5px 0 0;
    padding: 12px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.tools-page .htc-user-panel .htc-user-account {
    color: #173850;
}

    .tools-page .htc-user-panel .htc-user-account:hover {
        background: #f0f6fc;
    }

.tools-page .htc-user-panel .htc-user-logout {
    color: #ba3434;
}

    .tools-page .htc-user-panel .htc-user-logout:hover {
        background: #fff0f0;
    }

.tools-page .htc-user-panel a:focus-visible,
.tools-page .htc-user-panel button:focus-visible {
    outline: 2px solid #2580c5;
    outline-offset: -2px;
}

.tools-page .htc-user-logout:disabled {
    opacity: 0.6;
    cursor: wait;
}

.tools-page .htc-user-status {
    margin: 8px 4px 4px;
    padding: 10px;
    border-radius: 8px;
    background: #fff1f1;
    color: #a12c2c;
    font-size: 12px;
    line-height: 1.6;
}

/* Không bị các quy tắc display khác làm hiện phần ẩn */

.tools-page .htc-user-nav [hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .tools-page .htc-user-trigger {
        max-width: 230px;
    }

    .tools-page .htc-user-panel {
        width: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tools-page .htc-user-trigger,
    .tools-page .htc-user-chevron {
        transition: none;
    }
}
/* Nút tải bộ cài HTC Tools */

.tools-page .tools-page-actions .htc-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #f56a20;
    background: #f56a20;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
}

    .tools-page .tools-page-actions .htc-download-button:hover {
        border-color: #d9510c;
        background: #d9510c;
        color: #ffffff;
    }

.tools-page .htc-download-button > span {
    font-size: 22px;
    line-height: 1;
}

.tools-page .htc-download-note {
    max-width: 680px;
    margin: 18px auto 0;
    color: #596f83;
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}
/* Hai nút bằng nhau, căn giữa */

.tools-page .tools-page-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 16px;
    margin: 28px auto 0;
}

    .tools-page .tools-page-actions > .button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 1 240px;
        width: 240px;
        max-width: 100%;
        min-height: 54px;
        margin: 0;
        padding: 14px 22px;
        box-sizing: border-box;
        gap: 10px;
        font-size: 15px;
        font-weight: 700;
        line-height: 1.5;
        text-align: center;
        text-decoration: none;
    }

@media (max-width: 540px) {
    .tools-page .tools-page-actions {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

        .tools-page .tools-page-actions > .button {
            flex: none;
            width: 100%;
            max-width: 320px;
        }
}