/* Frontend học theo giao diện nhiệm vụ của nut-tai-manager */
#quiz-locker-container,
.dp-ntm-widget {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.dp-ntm-shell {
    width: min(760px, 100%);
    max-width: 100%;
    margin: 22px auto;
    box-sizing: border-box;
}

.ntm-modal-content.dp-ntm-content,
.dp-ntm-widget .ntm-modal-content {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    padding: 28px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.18);
    color: #111827;
    animation: ntmFadeIn 0.22s ease;
}

.ntm-modal-content * {
    box-sizing: border-box;
    max-width: 100%;
}

.ntm-loading {
    text-align: center;
    padding: 48px 20px;
    color: #475569;
    font-weight: 600;
}

.ntm-modal-title,
.dp-frontend-title {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 8px auto 10px;
    padding: 0 20px;
    color: #dc2626;
    text-align: center;
    font-size: 22px;
    font-weight: 850;
    line-height: 1.38;
    letter-spacing: -0.2px;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: normal;
}

.ntm-modal-note {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 22px;
    padding: 9px 14px;
    text-align: center !important;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.45;
}

.ntm-verify-area {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    width: 80%;
    margin: 0 auto 18px;
}

.ntm-code-input {
    flex: 1 1 260px;
    min-width: 0;
    width: 100%;
    max-width: none;
    padding: 14px 17px;
    color: #0f172a;
    background: #ffffff;
    border: 1.5px solid #dbe3ef;
    border-radius: 14px;
    font-size: 15px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.ntm-code-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.ntm-code-input:disabled {
    background: #f8fafc;
    color: #64748b;
}

.ntm-verify-btn {
    flex: 0 0 auto;
    min-width: 145px;
    background: #0b7cff;
    color: #fff;
    border: 0;
    padding: 14px 22px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(11, 124, 255, 0.24);
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.ntm-verify-btn:hover {
    background: #006be0;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(11, 124, 255, 0.28);
}

.ntm-verify-btn:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.ntm-error-msg {
    min-height: 20px;
    margin: 0 0 14px;
    text-align: center;
    color: #dc2626;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.45;
}

.ntm-error-msg:not(:empty) {
    color: #dc2626;
}

.ntm-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    line-height: 1.65;
    color: #111827;
}

.ntm-steps p {
    margin: 0;
}

.ntm-steps .highlight,
.highlight {
    color: #dc2626;
    font-weight: 850;
}

.ntm-steps .step-items {
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e5edf7;
    border-radius: 16px;
}

.ntm-steps .step-items p {
    width: 100%;
    margin: 0 0 12px;
}

.ntm-steps .dp-keyword-copy-row,
.dp-keyword-copy-row {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    width: fit-content;
    max-width: 100%;
}

.ntm-steps .keyword,
.keyword {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
    min-height: 50px;
    overflow-wrap: anywhere;
    word-break: break-word;
    background: #111827;
    color: #fff;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.25;
    box-sizing: border-box;
}

.ntm-steps .btn-copy,
.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 50px;
    background: #eb8f25;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    padding: 9px 16px;
    text-transform: uppercase;
    line-height: 1;
    box-sizing: border-box;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.ntm-steps .btn-copy:hover,
.btn-copy:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.ntm-steps .btn-copy.is-copied,
.btn-copy.is-copied {
    background: #16a34a;
}

.ntm-steps a {
    color: #0b7cff;
    font-weight: 800;
    text-decoration: none;
}

.ntm-steps a:hover {
    text-decoration: underline;
}

.ntm-steps .image,
.image {
    width: 100%;
    margin: -2px 0 0;
}

.ntm-steps .image img,
.image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    border-radius: 16px;
    border: 1px solid #dbe3ef;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.ntm-hint {
    margin-top: -3px !important;
    padding: 11px 13px;
    color: #334155;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    font-size: 14px;
    font-style: italic;
    line-height: 1.55;
}

.ntm-verify-bottom {
    margin-top: 6px;
    padding-top: 18px;
    border-top: 1px solid #e5edf7;
}

/* Kết quả sau khi xác nhận đúng mã */
.dp-result-box {
    margin-top: 4px;
    padding: 18px;
    text-align: center;
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border: 1px solid #bbf7d0;
    border-radius: 18px;
}

.dp-result-label {
    margin: 0 0 12px;
    color: #166534;
    font-size: 20px;
    line-height: 1.35;
    font-weight: 850;
}

.dp-result-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.dp-result-code {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    background: #ffffff;
    color: #111827;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px dashed #16a34a;
    font-family: Roboto, Arial, sans-serif;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.35;
}

.dp-copy-result {
    flex: 0 0 auto;
    background: #16a34a;
    color: #fff;
    border: 0;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    padding: 9px 14px;
    text-transform: uppercase;
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.dp-copy-result:hover {
    background: #15803d;
    transform: translateY(-1px);
}

.dp-copy-result.is-copied {
    background: #1d4ed8;
}

.dp-result-error {
    text-align: center;
    color: #dc2626;
    padding: 30px;
    font-weight: 800;
    border: 1px solid #fecaca;
    background: #fff1f2;
    border-radius: 14px;
}

/* Tương thích admin cũ nếu class cũ còn tồn tại đâu đó */
.quiz-locker-admin table thead tr th,
.quiz-locker-admin tbody tr td {
    border: 1px solid #dadada;
}

/* Hạ z-index sticky header Flatsome khi shortcode đang focus nhập mã */
body:has(#quiz-locker-container .ntm-code-input:focus) #header,
body:has(#quiz-locker-container .ntm-code-input:focus) #header .header-wrapper,
body:has(#quiz-locker-container .ntm-code-input:focus) .header-wrapper,
body:has(#quiz-locker-container .ntm-code-input:focus) .header-main,
body:has(#quiz-locker-container .ntm-code-input:focus) .header-bottom,
body:has(#quiz-locker-container .ntm-code-input:focus) .stuck,
body:has(#quiz-locker-container .ntm-code-input:focus) .sticky,
body:has(#quiz-locker-container .ntm-code-input:focus) .sticky-jump,
body:has(#quiz-locker-container .ntm-code-input:focus) .is-sticky,
body:has(#quiz-locker-container .ntm-code-input:focus) .sticky-wrapper {
    z-index: 1 !important;
}

@media (max-width: 760px) {
    .dp-ntm-shell {
        width: 100%;
        margin: 12px auto;
    }

    .ntm-modal-content.dp-ntm-content,
    .dp-ntm-widget .ntm-modal-content {
        width: 100%;
        min-height: auto;
        padding: 22px 15px;
        border-radius: 18px;
    }

    .ntm-modal-title,
    .dp-frontend-title {
        margin: 4px auto 12px;
        padding: 0;
        font-size: 18px;
        line-height: 1.45;
        text-align: center;
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .ntm-modal-note {
        width: 100%;
        border-radius: 12px;
        font-size: 12.5px;
    }

    .ntm-verify-area {
        flex-direction: column;
        gap: 9px;
    }

    .ntm-code-input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 100%;
        max-width: none;
        padding: 13px 15px;
        border-radius: 13px;
    }

    .ntm-verify-btn {
        width: 100%;
        min-width: 100%;
        padding: 13px 18px;
        border-radius: 13px;
    }

    .ntm-steps {
        gap: 12px;
        line-height: 1.6;
    }

    .ntm-steps .step-items {
        padding: 13px;
    }

    .ntm-steps .dp-keyword-copy-row,
    .dp-keyword-copy-row {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 9px;
    }

    .ntm-steps .keyword,
    .keyword {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 16px;
    }

    .ntm-steps .btn-copy,
    .btn-copy {
        width: 100%;
        padding: 10px 12px;
    }

    .ntm-hint {
        font-size: 13.5px;
    }

    .dp-result-line {
        flex-direction: column;
        align-items: stretch;
    }

    .dp-result-code {
        width: 100%;
        justify-content: center;
        text-align: center;
        font-size: 16px;
    }

    .dp-copy-result {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .ntm-modal-content.dp-ntm-content,
    .dp-ntm-widget .ntm-modal-content {
        padding-left: 12px;
        padding-right: 12px;
        border-radius: 15px;
    }

    .ntm-modal-title,
    .dp-frontend-title {
        margin: 4px auto 12px;
        font-size: 17px;
        line-height: 1.45;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ntm-modal-content,
    .ntm-verify-btn,
    .ntm-steps .btn-copy,
    .btn-copy,
    .dp-copy-result {
        animation: none;
        transition: none;
    }
}

@keyframes ntmFadeIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}
