

.nts-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    background: rgba(var(--primary-rgb), 0.08);
    color: var(--primary-dark);
    text-transform: uppercase;
}

.nts-level-badge.level-co-ban { background: rgba(var(--secondary-rgb), 0.1); color: #1d7a34; }
.nts-level-badge.level-nang-cao { background: rgba(var(--primary-rgb), 0.1); color: var(--primary-dark); }
.nts-level-badge.level-chuyen-gia { background: rgba(224, 168, 0, 0.12); color: #a67300; }

.nts-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.nts-rating-stars {
    position: relative;
    display: inline-flex;
    color: #e0e0e0;
}

.nts-rating-stars__fg {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    overflow: hidden;
    width: var(--nts-rating-percent, 0%);
    color: #f5a623;
}

.nts-rating-stars svg { flex: 0 0 auto; fill: currentColor; }

.nts-rating-count {
    font-size: 13px;
    color: #666;
}

.nts-star-picker {
    display: inline-flex;
    gap: 4px;
}

.nts-star-picker .nts-star {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #d8d8d8;
    transition: color .15s ease, transform .15s ease;
}

.nts-star-picker .nts-star:hover,
.nts-star-picker .nts-star.is-active {
    color: #f5a623;
    transform: scale(1.1);
}

.nts-gated-teaser {
    position: relative;
    max-height: 620px;
    overflow: hidden;
    margin-bottom: -1px;
}

.nts-gated-teaser::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 140px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff);
}

.nts-gated-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.06), rgba(var(--secondary-rgb), 0.05));
    border: 1px solid rgba(var(--primary-rgb), 0.12);
    margin: 30px 0;
}

.nts-gated-card__icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nts-gated-card__body { flex: 1 1 auto; }

.nts-gated-card__title {
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 4px;
}

.nts-gated-card__desc {
    font-size: 14px;
    color: #555;
    margin: 0 0 12px;
}

.nts-gated-card__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    background: var(--secondary);
    color: #fff;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}

.nts-gated-card__button:hover { background: #1d7a34; }

@media screen and (max-width: 549px) {
    .nts-gated-card { flex-direction: column; text-align: center; }
}

.nts-gated-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 25, 45, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.nts-gated-modal.is-open { display: flex; }

.nts-gated-modal__panel {
    background: #fff;
    border-radius: 16px;
    max-width: 440px;
    width: 100%;
    padding: 0 30px 30px;
    position: relative;
    overflow: hidden; /* bo góc dải sóng ở đầu panel */
    box-shadow: 0 30px 70px -20px rgba(15, 25, 45, 0.45);
    animation: ntsGatedPanelIn .3s cubic-bezier(.16,1,.3,1);
}

@keyframes ntsGatedPanelIn {
    from { opacity: 0; transform: translateY(14px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Dải sóng nước trang trí — chủ đề ngành xử lý nước ────────────────
   2 lớp <path> giống hệt nhau, trôi ngược chiều nhau vô hạn, tạo cảm giác
   mặt nước gợn sóng liên tục. Badge giọt nước nổi giữa, đè lên mép dưới
   dải sóng, có 2 vòng ripple lệch nhịp (gợi ý giọt nước rơi xuống mặt hồ). */
.nts-gated-modal__wave {
    position: relative;
    height: 96px;
    margin: 0 -30px 34px;
    background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.nts-gated-modal__wave svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.nts-gated-modal__wave-path { fill: rgba(255, 255, 255, .16); }
.nts-gated-modal__wave-path--front { fill: rgba(255, 255, 255, .26); }
.nts-gated-modal__wave-path--back { animation: ntsGatedWaveDrift 8s ease-in-out infinite; }
.nts-gated-modal__wave-path--front { animation: ntsGatedWaveDrift 5.5s ease-in-out infinite reverse; }

@keyframes ntsGatedWaveDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-34px); }
}

.nts-gated-modal__droplet-badge {
    position: absolute;
    left: 50%;
    bottom: -26px;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), #1d7a34);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px -4px rgba(40, 163, 74, .5), 0 0 0 5px #fff;
}

.nts-gated-modal__droplet-icon { width: 26px; height: 26px; color: #fff; }

.nts-gated-modal__ripple {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(40, 163, 74, .55);
    animation: ntsGatedRipple 2.6s ease-out infinite;
}

.nts-gated-modal__ripple--delay { animation-delay: 1.3s; }

@keyframes ntsGatedRipple {
    0% { transform: scale(1); opacity: .7; }
    100% { transform: scale(2); opacity: 0; }
}

.nts-gated-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: #fff;
    transition: background .2s ease;
}

.nts-gated-modal__close:hover { background: rgba(255, 255, 255, .32); }

.nts-gated-modal__title {
    margin: 0 0 6px;
    padding-top: 28px;
    color: var(--primary-dark);
    text-align: center;
}

.nts-gated-modal__desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px;
    text-align: center;
}

.nts-gated-modal__field { margin-bottom: 14px; }

.nts-gated-modal__field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
}

.nts-gated-modal__field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.nts-gated-modal__field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .15);
}

/* Ô nhập OTP — chữ số to, cách đều, căn giữa, phông đơn cách (dễ đọc/dễ soát
   lại từng số) thay vì 1 ô input trần cùng cỡ chữ với các field khác. */
.nts-gated-modal__otp-input {
    font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: .5em;
    text-align: center;
    color: var(--primary-dark);
    padding-left: calc(12px + .5em) !important; /* bù lệch letter-spacing để chữ số đầu không dính lề trái */
}

.nts-gated-modal__submit {
    display: block;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    margin-top: 6px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.nts-gated-modal__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px -8px rgba(var(--primary-rgb), .6);
}

.nts-gated-modal__submit:disabled { opacity: .6; cursor: not-allowed; }

.nts-gated-modal__link {
    display: block;
    width: 100%;
    background: none;
    border: none;
    color: var(--primary);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 10px;
    padding: 0;
}

/* Hàng "Gửi lại mã" / "Dùng email khác" ở bước nhập OTP — 2 lựa chọn tách
   biệt rõ ràng: gửi lại (tái dùng mã cũ nếu server còn cho phép, xem
   technical-articles.js) không rời khỏi bước này; đổi email mới thật sự quay
   lại bước 1. Trước đây gộp chung 1 nút "Quay lại / gửi lại mã" luôn nhảy về
   bước 1 — đúng nguyên nhân khiến vài lần bấm nhầm/gõ sai mã là phải gửi lại
   từ đầu và dễ dính giới hạn 3 lần/10 phút. */
.nts-gated-otp-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 12px;
}

.nts-gated-modal__resend {
    background: none;
    border: none;
    padding: 0;
    color: var(--secondary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.nts-gated-modal__resend:disabled { color: #999; cursor: not-allowed; }

.nts-gated-modal__cooldown { font-weight: 400; color: #999; }

.nts-gated-otp-actions .nts-gated-modal__link { width: auto; margin-top: 0; }

.nts-gated-modal__message {
    font-size: 13px;
    color: #1d7a34;
    min-height: 18px;
    margin-top: 12px;
}

.nts-gated-modal__message.is-error { color: #c0392b; }

.nts-gated-modal__download { margin-top: 4px; }

/* ── Bước thành công — giọt nước bung ripple + dấu tick vẽ nét ─────── */
.nts-gated-modal__success-icon {
    position: relative;
    width: 64px;
    height: 64px;
    margin: 8px auto 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), #1d7a34);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nts-gated-modal__success-icon svg {
    width: 30px;
    height: 30px;
    color: #fff;
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: ntsGatedCheckDraw .5s .15s ease-out forwards;
}

.nts-gated-modal__ripple--success {
    border-color: rgba(40, 163, 74, .5);
    animation-name: ntsGatedRipple;
    animation-duration: 1.6s;
    animation-iteration-count: 2;
}

@keyframes ntsGatedCheckDraw {
    to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .nts-gated-modal__panel,
    .nts-gated-modal__wave-path,
    .nts-gated-modal__ripple,
    .nts-gated-modal__success-icon svg {
        animation: none !important;
    }
}

.nts-article-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease, box-shadow .25s ease;
}

.nts-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

.nts-article-card__thumb { position: relative; }
.nts-article-card__thumb img { width: 100%; height: 190px; object-fit: cover; display: block; }

.nts-article-card__body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }

.nts-article-card__title {
    font-size: 17px;
    margin: 10px 0 8px;
    color: var(--primary-dark);
}

.nts-article-card__excerpt { font-size: 14px; color: #666; flex: 1; }

.nts-article-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.nts-article-filter a {
    padding: 8px 16px;
    border-radius: 999px;
    background: #f1f1f1;
    color: #444;
    font-size: 14px;
    text-decoration: none;
    transition: background .2s ease, color .2s ease;
}

.nts-article-filter a:hover,
.nts-article-filter a.is-active {
    background: var(--primary);
    color: #fff;
}
