@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ══════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Sora', sans-serif;
    background: transparent;
    color: #1a1d2e;
    font-size: 14px;
    line-height: 1.6;
    padding: 0;
    margin: 0;
}

/* ── Container: giống trang giấy A4 ── */
.container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 24px 40px 32px;
}

/* ══════════════════════════════════════════
   LƯU Ý & TIÊU ĐỀ
══════════════════════════════════════════ */
.note {
    color: #dc2626;
    font-size: 12.5px;
    font-style: italic;
    margin: 0 0 12px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    text-align: left;
}

.sao { color: #dc2626; font-style: normal; }

.title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    font-family: 'Sora', sans-serif;
    color: #1a1d2e;
    line-height: 1.4;
}

/* Phụ đề dưới title (vd: ghi chú về giá trị pháp lý) */
.subtitle {
    text-align: center;
    font-size: 13px;
    font-style: italic;
    color: #5a607a;
    margin-bottom: 22px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    line-height: 1.5;
}

/* ══════════════════════════════════════════
   SECTIONS
══════════════════════════════════════════ */
.section {
    margin-bottom: 12px;
}

/* Section căn giữa — cho phần chọn đối tượng */
.section-center {
    text-align: center;
}
.section-center .section-title {
    text-align: center;
}
.section-center .checkbox-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px 40px;
}

.section-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1d2e;
    font-family: 'Sora', sans-serif;
    display: block;
    border-bottom: none;
    padding-bottom: 0;
    letter-spacing: -.01em;
}

/* Tùy chỉnh text phần VI, VII */
.section-title .note,
.section-title em {
    font-size: 12.5px;
    font-weight: 400;
    font-style: italic;
    color: #5a607a;
    display: inline;
    margin: 0;
}

.section-title .vi {
    font-size: 13px;
    font-weight: 400;
    color: #1a1d2e;
    display: block;
    margin-top: 4px;
    line-height: 1.6;
    font-style: normal;
}

/* Phụ chú trong section-title (vd: "(Gọi tắt là Khách hàng)") */
.section-title-note {
    font-size: 12.5px;
    font-weight: 400;
    font-style: italic;
    color: #5a607a;
    display: inline;
    letter-spacing: 0;
}

/* Tiêu đề subsection (vd: "A. Đối với khách hàng là Doanh nghiệp") */
.subsection-title {
    font-size: 13px;
    font-weight: 600;
    color: #6c5ce7;
    margin: 12px 0 6px;
    font-family: 'Sora', sans-serif;
    padding-left: 8px;
    border-left: 3px solid #6c5ce7;
    line-height: 1.4;
}
.subsection-title:first-child {
    margin-top: 0;
}

/* ══════════════════════════════════════════
   FORM ROWS — dạng label + đường kẻ ngang
══════════════════════════════════════════ */
.form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
    margin-bottom: 4px;
    width: 100%;
}

/* Form-row dạng "Label: [✓] Opt1 [✓] Opt2" — label và checkbox cùng hàng */
.form-row-inline {
    align-items: center;
    margin-bottom: 6px;
    min-height: 22px;
}
.form-row-inline .inline-label {
    font-size: 13px;
    font-weight: 600;
    color: #1a1d2e;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Sora', sans-serif;
    line-height: 22px;
    height: 22px;
    margin: 0;
    display: inline-flex;
    align-items: center;
}
.form-row-inline .checkbox-group {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    align-items: center;
}

/* Note dạng paragraph trong form-row (vd: "3. Yêu cầu khác: ...") */
.inline-note {
    font-size: 13px;
    font-weight: 400;
    color: #5a607a;
    line-height: 1.6;
    margin: 0;
    flex: 1;
    font-family: 'Sora', sans-serif;
}
.inline-note strong {
    color: #1a1d2e;
    font-weight: 600;
    margin-right: 4px;
}

/* Hint phụ trong form-row (vd: "(Ví dụ: 06, 12, 24...)") */
.inline-hint {
    font-size: 12px;
    color: #9499b0;
    font-style: italic;
    font-weight: 400;
    margin-left: 4px;
    white-space: nowrap;
}

/* Input số + đơn vị (vd: "[12] tháng") */
.input-with-unit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.input-with-unit input[type="number"] {
    width: 110px;
    text-align: center;
    border: 1px solid #cdd1e0;
    border-radius: 6px;
    padding: 5px 10px;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1d2e;
    background: #fff;
    outline: none;
    min-height: 30px;
    transition: border-color .2s, box-shadow .2s;
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-with-unit input[type="number"]::-webkit-inner-spin-button,
.input-with-unit input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.input-with-unit input[type="number"]:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108,92,231,.12);
}
.input-with-unit input[type="number"]::placeholder {
    color: #9499b0;
    font-weight: 400;
    font-style: italic;
}
.input-with-unit .unit {
    font-size: 13px;
    color: #5a607a;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
}

/* Checkbox disabled — option chưa khả dụng */
.checkbox-container.disabled {
    opacity: .5;
    cursor: not-allowed;
}
.checkbox-container.disabled .checkmark {
    background: #f5f6fa;
    border-color: #cdd1e0;
}
.checkbox-container.disabled:hover .checkmark {
    border-color: #cdd1e0;
}

/* Vùng văn bản cam kết / xác nhận */
.confirm-text {
    background: #faf9ff;
    border: 1px solid #eeecfd;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 13px;
    line-height: 1.65;
    color: #1a1d2e;
}
.confirm-text p {
    margin: 0 0 8px;
    color: #1a1d2e;
    font-weight: 500;
}
.confirm-text ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}
.confirm-text ul li {
    position: relative;
    padding-left: 14px;
    margin-bottom: 4px;
    color: #5a607a;
}
.confirm-text ul li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #6c5ce7;
    font-weight: 700;
}
.confirm-text ul li:last-child {
    margin-bottom: 0;
}

/* ══════════════════════════════════════════
   UTILITY & MISC COMPONENTS
══════════════════════════════════════════ */

/* Ẩn element */
.hidden {
    display: none !important;
}

/* Utility: căn giữa text trong input — dùng cho cột mã, code (không phải tiền) */
input.text-center,
.money-input.text-center {
    text-align: center !important;
}

/* ══════════════════════════════════════════
   TOAST NOTIFICATION — thông báo nhẹ trên màn hình
   (Glass · gradient accent · progress bar)
══════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 30px;
    right: 8px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 390px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    background: rgba(255,255,255,.82);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid rgba(228,232,240,.9);
    border-radius: 14px;
    padding: 14px 16px 14px 18px;
    box-shadow:
        0 1px 2px rgba(26,29,46,.04),
        0 6px 16px rgba(26,29,46,.08),
        0 16px 40px rgba(26,29,46,.10);
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #1a1d2e;
    pointer-events: auto;
    min-width: 290px;
    transform: translateX(120%);
    opacity: 0;
    transition:
        transform .45s cubic-bezier(.34,1.56,.64,1),
        opacity .3s ease,
        box-shadow .25s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* Dải màu accent dọc bên trái — gradient mềm theo loại */
.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor; /* fallback */
    background: linear-gradient(180deg, currentColor, color-mix(in srgb, currentColor 55%, transparent));
    border-radius: 14px 0 0 14px;
}


.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.show:hover {
    transform: translateY(-2px);
    box-shadow:
        0 2px 4px rgba(26,29,46,.05),
        0 10px 24px rgba(26,29,46,.10),
        0 24px 56px rgba(26,29,46,.14);
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Thanh tiến trình dưới đáy toast */
.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: currentColor; /* fallback */
    background: linear-gradient(90deg, currentColor, color-mix(in srgb, currentColor 45%, transparent));
    border-radius: 0 3px 0 0;

    opacity: .55;
    transform-origin: left;
    animation: toast-progress 3.5s linear forwards;
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

.toast .toast-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    margin-top: 0;
    box-shadow: 0 3px 8px color-mix(in srgb, currentColor 40%, transparent);
}

.toast .toast-content {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.toast .toast-title {
    font-weight: 600;
    font-size: 13.5px;
    margin: 0 0 2px;
    color: #1a1d2e;
    letter-spacing: -.01em;
}

.toast .toast-message {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #5a607a;
    word-wrap: break-word;
}

/* Nút đóng (×) — đã ẩn theo yêu cầu, toast tự biến mất sau vài giây */
.toast .toast-close {
    display: none;
}


/* Toast variants — màu accent dùng cho ::before, ::after, icon & shadow qua currentColor */
.toast--warning {
    color: #fd7935;
    background:
        linear-gradient(90deg, rgba(253,121,53,.07), rgba(253,121,53,0) 38%),
        rgba(255,255,255,.82);
}
.toast--warning .toast-icon {
    background: linear-gradient(135deg, #fd7935, #ff9a5e);
}

.toast--error {
    color: #dc2626;
    background:
        linear-gradient(90deg, rgba(220,38,38,.07), rgba(220,38,38,0) 38%),
        rgba(255,255,255,.82);
}
.toast--error .toast-icon {
    background: linear-gradient(135deg, #dc2626, #f05252);
}

.toast--success {
    color: #16a34a;
    background:
        linear-gradient(90deg, rgba(22,163,74,.07), rgba(22,163,74,0) 38%),
        rgba(255,255,255,.82);
}
.toast--success .toast-icon {
    background: linear-gradient(135deg, #16a34a, #34d27e);
}

.toast--info {
    color: #6c5ce7;
    background:
        linear-gradient(90deg, rgba(108,92,231,.07), rgba(108,92,231,0) 38%),
        rgba(255,255,255,.82);
}
.toast--info .toast-icon {
    background: linear-gradient(135deg, #6c5ce7, #8b7ee8);
}

/* Mobile responsive */
@media (max-width: 575px) {
    .toast-container {
        top: 60px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
    .toast {
        min-width: 0;
    }
}


/* Đoạn intro ngắn dưới section-title (vd: "Chúng tôi đồng ý đăng ký...") */
.section-intro {
    font-size: 13px;
    color: #5a607a;
    line-height: 1.55;
    margin: 0 0 8px;
    font-style: italic;
    font-family: 'Sora', sans-serif;
}

/* Input text nhập tay xen kẽ trong checkbox-group (vd: "Khác: [____]") */
.inline-text-input {
    flex-shrink: 0;
    width: 160px;
    border: none;
    border-bottom: 1px solid #cdd1e0;
    border-radius: 0;
    padding: 4px 6px 2px;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    background: transparent;
    outline: none;
    line-height: 1.3;
    min-height: 22px;
    transition: border-bottom-color .2s, background .2s;
}
.inline-text-input:focus {
    border-bottom-color: #6c5ce7;
    background: #faf9ff;
}
.inline-text-input::placeholder {
    color: #9499b0;
    font-style: italic;
    font-size: 12px;
    font-weight: 400;
}

/* Link tím — đồng bộ tông HTECHVN */
.link-tim {
    color: #6c5ce7;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed rgba(108,92,231,.35);
    transition: color .15s, border-color .15s;
}
.link-tim:hover {
    color: #fd7935;
    border-bottom-color: rgba(253,121,53,.55);
}

/* Date input xen kẽ trong văn bản (vd: "Hôm nay, ngày [____]")
   Dùng input[type="date"].inline-date-input để thắng .form-row input[type="date"] */
input[type="date"].inline-date-input {
    flex: 0 0 150px !important;
    width: 150px !important;
    max-width: 150px !important;
    min-width: 0 !important;
    border: none;
    border-bottom: 1px solid #cdd1e0;
    border-radius: 0;
    padding: 0 6px 4px;
    margin-top: -5px;
    font-family: 'JetBrains Mono', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    background: transparent;
    outline: none;
    line-height: 1.3;
    min-height: 22px;
    transition: border-bottom-color .2s, background .2s;
}
input[type="date"].inline-date-input:focus {
    border-bottom-color: #6c5ce7;
    background: #faf9ff;
}

/* ══════════════════════════════════════════
   CONTRACT TABLE — bảng giá trong hợp đồng
══════════════════════════════════════════ */
.contract-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0;
    border-radius: 8px;
    border: 1px solid #d8dce8;
}

.contract-table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    font-family: 'Sora', sans-serif;
}

.contract-table thead th {
    background: linear-gradient(135deg, #faf9ff 0%, #fff5ed 100%);
    color: #1a1d2e;
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    padding: 10px 8px;
    border-bottom: 2px solid #d8dce8;
    border-right: 1px solid #e4e8f0;
    letter-spacing: .2px;
}
.contract-table thead th:last-child {
    border-right: none;
}

.contract-table tbody td {
    padding: 10px 8px;
    border-top: 1px solid #e4e8f0;
    border-right: 1px solid #e4e8f0;
    vertical-align: top;
    font-size: 13px;
    color: #1a1d2e;
}
.contract-table tbody td:last-child {
    border-right: none;
}

/* Các cell chứa input tiền — căn giữa theo chiều dọc */
.contract-table tbody td.td-money {
    vertical-align: middle;
}

.contract-table tbody tr:first-child td {
    border-top: none;
}

.contract-table .td-center {
    text-align: center;
    vertical-align: middle;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #6c5ce7;
}

.contract-table .product-name {
    font-weight: 600;
    color: #1a1d2e;
    font-size: 13px;
    margin-bottom: 2px;
}

/* Chú thích nhỏ dưới product-name */
.contract-table .product-note {
    font-size: 12px;
    color: #5a607a;
    font-style: italic;
    font-weight: 400;
    margin-top: 2px;
}

/* Chữ phụ trong header bảng (vd: "(1)", "(3) = (1)×(2)") */
.contract-table thead th small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #5a607a;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0;
}

/* Dòng "Tổng cộng" — nổi bật */
.contract-table .row-total td {
    background: linear-gradient(135deg, #faf9ff 0%, #fff5ed 100%);
    font-weight: 700;
    border-top: 2px solid #d8dce8;
    vertical-align: middle;
}
.contract-table .td-total-label {
    text-align: right;
    color: #1a1d2e;
    font-size: 13.5px;
    padding-right: 12px !important;
    text-transform: uppercase;
    letter-spacing: .3px;
    font-family: 'Sora', sans-serif;
}

/* Form select — dropdown style đồng bộ */
.form-select {
    flex: 1;
    min-width: 0;
    padding: 6px 32px 6px 10px;
    border: 1px solid #cdd1e0;
    border-radius: 6px;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c5ce7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color .2s, box-shadow .2s, background-color .2s;
    line-height: 1.4;
    min-height: 32px;
}
.form-select:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108,92,231,.12);
    background-color: #faf9ff;
}
.form-select:hover {
    border-color: #a8a4e3;
}

/* Money input — ô nhập tiền có nền nhẹ, số căn phải */
.money-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #cdd1e0;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'Inter', monospace;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    background: #fff;
    outline: none;
    text-align: right;
    min-height: 32px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.money-input:focus {
    border-color: #6c5ce7;
    box-shadow: 0 0 0 3px rgba(108,92,231,.12);
    background: #faf9ff;
}
.money-input::placeholder {
    color: #9499b0;
    font-weight: 400;
}

/* Money readonly — ô tự động tính (không click, không gõ được) */
.money-readonly {
    background: #f5f6fa;
    border-color: #e4e8f0;
    color: #5a607a;
    cursor: not-allowed;
}
.money-readonly:focus {
    background: #f5f6fa;
    border-color: #e4e8f0;
    box-shadow: none;
}

@media (max-width: 575px) {
    .contract-table {
        border-radius: 6px;
    }
    .contract-table table {
        min-width: 600px;
    }
}

/* ══════════════════════════════════════════
   DIFF TABLE — bảng so sánh thông tin cũ/mới
   (Style đơn giản, viền rõ ràng để dễ nhập liệu)
══════════════════════════════════════════ */
.diff-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0;
}

.diff-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    font-family: 'Sora', sans-serif;
}

.diff-table thead th {
    background: #f5f6fa;
    color: #1a1d2e;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding: 8px 10px;
    border: 1px solid #d8dce8;
    letter-spacing: .2px;
}

.diff-table tbody td {
    border: 1px solid #d8dce8;
    padding: 6px 10px;
    font-size: 13px;
    color: #1a1d2e;
    vertical-align: top;
}

.diff-table .td-label {
    background: #faf9ff;
    font-weight: 600;
    color: #1a1d2e;
    vertical-align: middle;
    width: 25%;
}

.diff-textarea {
    width: 100%;
    border: none;
    border-bottom: 1px dashed #5a607a;
    border-radius: 0;
    padding: 4px 2px 2px;
    background: transparent;
    resize: none;
    overflow: hidden;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    line-height: 1.5;
    outline: none;
    min-height: 26px;
    transition: border-bottom-color .2s, background .2s;
    box-sizing: border-box;
}
.diff-textarea:focus {
    border-bottom-color: #6c5ce7;
    background: #faf9ff;
}
.diff-textarea::placeholder {
    color: #9499b0;
    font-style: italic;
}

@media (max-width: 575px) {
    .diff-table {
        min-width: 520px;
    }
}

.form-row label {
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Sora', sans-serif;
    line-height: 28px;
    margin-right: 0;
}

/* Input dạng đường kẻ — đường kẻ mờ, sát chữ */
.form-row input[type="text"],
.form-row input[type="email"],
.form-row input[type="date"] {
    flex: 1;
    min-width: 80px;
    border: none;
    border-bottom: 1px solid #cdd1e0;
    border-radius: 0;
    padding: 10px 4px 0;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1d2e;
    background: transparent;
    outline: none;
    line-height: 1.5;
    height: auto;
    min-height: 30px;
    box-shadow: none;
    margin-right: 0;
    transition: border-bottom-color .2s, background .2s;
}

.form-row input:focus {
    border-bottom-color: #6c5ce7;
    background: #faf9ff;
}

.form-row input::placeholder {
    color: #9499b0;
    font-style: italic;
    font-size: 12px;
    font-weight: 400;
}

/* ══════════════════════════════════════════
   NÚT LẤY MST — gradient tím, hiệu ứng shine
══════════════════════════════════════════ */
#get_tax_info {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-family: 'Sora', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6c5ce7 0%, #8b7ee8 100%);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    letter-spacing: .2px;
    box-shadow: 0 2px 6px rgba(108,92,231,.25);
    transition: transform .15s, box-shadow .2s, filter .2s;
    margin-left: 8px;
    line-height: 1.4;
    position: relative;
    overflow: hidden;
}

/* Icon kính lúp phía trước */
#get_tax_info::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 11px;
    margin-right: 2px;
}

/* Shine effect khi hover */
#get_tax_info::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
    transition: left .55s ease;
    pointer-events: none;
}

#get_tax_info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108,92,231,.42);
    filter: brightness(1.05);
}
#get_tax_info:hover::after { left: 100%; }

#get_tax_info:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(108,92,231,.2);
}

#get_tax_info:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 6px rgba(108,92,231,.15);
    filter: none;
}
#get_tax_info:disabled::after { display: none; }

/* Warning note MST */
.tax-note {
    display: block;
    width: 100%;
    font-size: 11.5px;
    color: #dc2626;
    font-style: italic;
    margin-top: 4px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
}

/* ══════════════════════════════════════════
   CHECKBOX / RADIO — ô vuông trước nhãn
══════════════════════════════════════════ */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-bottom: 8px;
    align-items: center;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    font-family: 'Sora', sans-serif;
    line-height: 18px;
    min-height: 22px;
    user-select: none;
    position: relative;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    width: 0; height: 0;
    pointer-events: none;
}

/* Ô vuông checkbox — đưa ra trước text bằng flex order */
.checkmark {
    order: -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1.5px solid #5a607a;
    background: #fff;
    flex-shrink: 0;
    flex-grow: 0;
    border-radius: 4px;
    color: #fff;
    transition: background .15s, border-color .15s, transform .15s;
    position: relative;
    top: 0;
    line-height: 1;
    box-sizing: border-box;
}

.checkmark::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
    display: none;
}

.checkbox-container:hover .checkmark {
    border-color: #6c5ce7;
}

.checkbox-container input:checked ~ .checkmark {
    background: #6c5ce7;
    border-color: #6c5ce7;
}

.checkbox-container input:checked ~ .checkmark::after { display: block; }

.checkbox-container:active .checkmark {
    transform: scale(.92);
}

/* ══════════════════════════════════════════
   FOOTER — chân trang ký tên & nút tải
══════════════════════════════════════════ */
.footer {
    margin-top: 22px;
    padding-top: 6px;
    text-align: center;
}

.footer .form-row {
    justify-content: flex-end;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 10px;
}

.footer .form-row input {
    flex: none;
}

.footer .form-row input[type="text"] {
    width: 200px;
}

.footer .form-row input[type="date"] {
    width: 160px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
}

/* ── Wrapper nút tải — override inline style="text-align:center" ── */
.footer > div[style*="text-align"],
.footer > div[style*="center"] {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
}

/* Nút tải */
.download-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 24px;
    font-family: 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s, transform .12s, box-shadow .18s;
    white-space: nowrap;
    letter-spacing: .2px;
    color: #fff;
    background: #8b7ee8;
    box-shadow: 0 2px 6px rgba(108,92,231,.14);
    margin-top: 0;
}

.download-button:hover {
    background: #6c5ce7;
    box-shadow: 0 4px 12px rgba(108,92,231,.22);
    transform: translateY(-1px);
}

.download-button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.download-button:active   { transform: scale(.97); }

.word-button {
    background: #2563eb;
    box-shadow: 0 2px 8px rgba(37,99,235,.28);
}
.word-button:hover { background: #1d4ed8; box-shadow: 0 4px 14px rgba(37,99,235,.38); }

.pdf-button {
    background: #dc2626;
    box-shadow: 0 2px 8px rgba(220,38,38,.25);
}
.pdf-button:hover { background: #b91c1c; box-shadow: 0 4px 14px rgba(220,38,38,.35); }

/* Nút xem/in — phân biệt bằng màu teal */
.pdf-button + .pdf-button,
.pdf-button:last-of-type {
    background: #0891b2;
    box-shadow: 0 2px 8px rgba(8,145,178,.25);
}
.pdf-button:last-of-type:hover { background: #0e7490; }

/* Nút ký số & tải phiếu — phân biệt bằng màu xanh lá */
.sign-button {
    background: #16a34a;
}
.sign-button:hover { background: #15803d; box-shadow: 0 4px 14px rgba(22,163,74,.35); }

/* ── Spinner ── */
.loading-icon {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    vertical-align: middle;
    margin-left: 5px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dấu sao yêu cầu ── */
.req {
    color: #dc2626;
    display: none;
    font-style: normal;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
}

/* ══════════════════════════════════════════
   PROVIDER CARD — thẻ thông tin bên cung cấp
══════════════════════════════════════════ */
.provider-card {
    background: linear-gradient(135deg, #faf9ff 0%, #fff5ed 100%);
    border: 1px solid #eeecfd;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 4px;
}

.provider-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #6c5ce7;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(108,92,231,.25);
    letter-spacing: .2px;
    font-family: 'Sora', sans-serif;
}
.provider-name i {
    font-size: 15px;
    color: #fd7935;
}

.provider-info {
    margin: 0;
    display: grid;
    gap: 4px;
}

.provider-info .info-row {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 8px 12px;
    align-items: baseline;
    font-size: 13px;
    line-height: 1.5;
}

.provider-info dt {
    font-weight: 500;
    color: #5a607a;
    font-family: 'Sora', sans-serif;
}
.provider-info dt::after { content: ':'; }

.provider-info dd {
    margin: 0;
    color: #1a1d2e;
    font-family: 'Inter', 'Sora', sans-serif;
    font-weight: 400;
}
.provider-info dd strong {
    font-weight: 600;
    color: #1a1d2e;
}

@media (max-width: 575px) {
    .provider-info .info-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .provider-info dt {
        font-size: 12px;
        margin-top: 4px;
    }
}

/* ══════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════ */
@media (max-width: 640px) {
    .container { padding: 16px 14px 24px; }

    .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .form-row label {
        line-height: 1.5;
        white-space: normal;
        margin-bottom: 0;
    }

    .form-row input[type="text"],
    .form-row input[type="email"],
    .form-row input[type="date"],
    #get_tax_info {
        width: 100%;
        flex: none;
        margin-left: 0;
        justify-content: center;
        box-sizing: border-box;
    }

    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .footer { text-align: left; }

    .footer .form-row {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .footer .form-row input[type="text"],
    .footer .form-row input[type="date"] {
        width: 100%;
    }

    .download-button { width: 100%; justify-content: center; margin: 0; }

    .form-row button {
        margin-top: 0;
        margin-left: 0;
    }
}

/* ── iOS anti-zoom ── */
input, select, textarea {
    font-size: 14px !important;
}

/* ══════════════════════════════════════════
   Khối Tự động nhập từ Giấy ĐKKD (AI)
   Dùng chung cho các form (Newtel, I-CA, ...)
══════════════════════════════════════════ */
.dkkd-ai-box {
    border: 1px solid #d6e4ff;
    background: linear-gradient(135deg, #f5f9ff 0%, #eef4ff 100%);
    border-radius: 8px;
    padding: 11px 14px;
    margin-bottom: 16px;
}
.dkkd-ai-head {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 9px;
}
.dkkd-ai-head > i {
    font-size: 15px;
    color: #2563eb;
    margin-top: 2px;
    flex-shrink: 0;
}
.dkkd-ai-head strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.28;
}
.dkkd-ai-head span {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
    line-height: 1.32;
}
.dkkd-ai-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}
.dkkd-file-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 200px;
    padding: 8px 13px;
    background: #f8faff;
    border: 1.5px dashed #b4c6ff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12.5px;
    color: #475569;
    transition: border-color .15s, background .15s, box-shadow .15s;
}
.dkkd-file-label:hover,
.dkkd-file-label.dragover {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12);
}
.dkkd-file-label i { color: #4f46e5; font-size: 15px; }
.dkkd-file-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dkkd-file-label.has-file {
    border-style: solid;
    border-color: #4f46e5;
    background: #fff;
    color: #1e293b;
}
.dkkd-file-label.has-file i { color: #16a34a; }
.dkkd-analyze-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 7px 18px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    background-size: 160% 160%;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 6px 16px -6px rgba(59, 130, 246, .7);
    transition: transform .12s, box-shadow .15s, background-position .4s;
}
.dkkd-analyze-btn:hover:not(:disabled) {
    background-position: 100% 0;
    box-shadow: 0 8px 20px -6px rgba(59, 130, 246, .8);
    transform: translateY(-1px);
}
.dkkd-analyze-btn:active:not(:disabled) { transform: translateY(0); }
.dkkd-analyze-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-20deg);
}
.dkkd-analyze-btn:hover:not(:disabled)::before {
    animation: dkkdShine .8s ease;
}
@keyframes dkkdShine {
    from { left: -120%; }
    to   { left: 140%; }
}
.dkkd-analyze-btn:disabled {
    background: linear-gradient(135deg, #a5b4fc, #93c5fd);
    cursor: not-allowed;
    box-shadow: none;
}
@media (max-width: 560px) {
    .dkkd-analyze-btn { flex: 1; }
}

/* ══════════════════════════════════════════
   NÚT COPY THÔNG TIN (cạnh tiêu đề mục con)
══════════════════════════════════════════ */
.copy-info-btn {
    margin-left: 10px;
    padding: 4px 10px;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #4f46e5;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
    vertical-align: middle;
}
.copy-info-btn i { margin-right: 4px; }
.copy-info-btn:hover {
    background: #e0e7ff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, .18);
    transform: translateY(-1px);
}
.copy-info-btn:active { transform: translateY(0); }


