@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 ĐỀ
══════════════════════════════════════════ */
.notee {
    color: #dc2626;
    font-size: 12.5px;
    font-style: italic;
    margin-bottom: 12px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
}

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

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

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

.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;
}

.section-title .note {
    font-size: 12.5px;
    font-weight: 400;
    font-style: italic;
    color: #5a607a;
}

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

/* ══════════════════════════════════════════
   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 label {
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: 'Sora', sans-serif;
    line-height: 28px;
}

/* Input dạng đường kẻ — giống phiếu in
   Dùng font Inter: dấu tiếng Việt rõ, gọn, dễ đọc hơn Sora */
.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: 8px 4px 0;
    font-family: 'Inter', 'Sora', sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: #1a1d2e;
    background: transparent;
    outline: none;
    line-height: 1.3;
    height: auto;
    min-height: 28px;
    box-shadow: none;
    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
══════════════════════════════════════════ */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 22px;
    margin-bottom: 8px;
    align-items: center;
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #1a1d2e;
    font-family: 'Sora', sans-serif;
    line-height: 18px;
    user-select: none;
    position: relative;
    padding: 1px 0;
    background: none;
    border: none;
    border-radius: 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;
    border: 1.5px solid #5a607a;
    background: #fff;
    flex-shrink: 0;
    border-radius: 4px;
    color: #fff;
    transition: background .15s, border-color .15s, transform .15s;
    position: relative;
    top: 0;
}

.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; }

/* Hiệu ứng nhấn nhẹ khi click */
.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;
}

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

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

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

/* ── Wrapper nút tải ── */
.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;
}

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

.word-button {
    background: #2563eb;
    color: #fff;
    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); transform: translateY(-1px); }

.pdf-button {
    background: #dc2626;
    color: #fff;
    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); transform: translateY(-1px); }

/* 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; transform: translateY(-1px); }

/* ── 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;
}

@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;
}

/* ══════════════════════════════════════════
   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; }

    .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;
    }

    .checkbox-group { gap: 8px 16px; }

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

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

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