/*
 * Popup tư vấn/dùng thử — thiết kế card 480px.
 * Toàn bộ rule được scope dưới #main-popup để không rò rỉ style ra ngoài
 * và đủ specificity override Bootstrap / magnific-popup.
 */

#main-popup,
#main-popup *,
#main-popup *::before,
#main-popup *::after {
    box-sizing: border-box;
}

/* Đảm bảo thuộc tính hidden luôn thắng các rule display bên dưới
   (nút submit dùng display:flex nên sẽ đè [hidden] mặc định của trình duyệt). */
#main-popup [hidden] {
    display: none !important;
}

#main-popup {
    width: min(480px, calc(100vw - 32px));
    margin: 0 auto;
    color: #0f172a;
}

#main-popup .main-popup__card {
    position: relative;
    background: #ffffff;
    border: 1px solid #edf0f5;
    border-radius: 16px;
    padding: 32px 36px 28px;
    box-shadow:
        0 12px 36px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Nút đóng: giữ class .mfp-close để magnific popup xử lý sự kiện đóng. */
#main-popup .main-popup__close {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f4f5f7;
    color: #64748b;
    font-family: inherit;
    font-size: 18px;
    line-height: 1;
    opacity: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#main-popup .main-popup__close:hover,
#main-popup .main-popup__close:focus-visible {
    background: #e6f4ff;
    color: #0070f3;
}

#main-popup .main-popup__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: #e6f4ff;
    color: #0070f3;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: inherit;
}

#main-popup .main-popup__tag-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #0070f3;
}

#main-popup .main-popup__title {
    margin: 0 0 6px;
    color: #0f172a;
    font-family: inherit;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.3;
}

#main-popup .main-popup__title-highlight {
    color: #0070f3;
}

#main-popup .main-popup__subtitle {
    margin: 0 0 22px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.45;
}

#main-popup .main-popup__form {
    margin: 0;
}

#main-popup .main-popup__field {
    margin-bottom: 14px;
    text-align: left;
}

#main-popup .main-popup__label {
    display: block;
    margin-bottom: 6px;
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 600;
}

#main-popup .main-popup__req {
    margin-left: 2px;
    color: #ef4444;
}

#main-popup .main-popup__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

#main-popup .main-popup__input-icon {
    position: absolute;
    left: 14px;
    display: flex;
    align-items: center;
    color: #94a3b8;
    pointer-events: none;
}

#main-popup .main-popup__input,
#main-popup .main-popup__select {
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #0f172a;
    font-family: inherit;
    font-size: 13.5px;
    line-height: normal;
    outline: none;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

#main-popup .main-popup__input::placeholder {
    color: #94a3b8;
    font-size: 13px;
}

#main-popup .main-popup__input:focus,
#main-popup .main-popup__select:focus {
    border-color: #0070f3;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 112, 243, 0.12);
}

#main-popup .main-popup__select {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

#main-popup .main-popup__select-chevron {
    position: absolute;
    right: 14px;
    display: flex;
    align-items: center;
    color: #94a3b8;
    pointer-events: none;
}

#main-popup .main-popup__message {
    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}

#main-popup .main-popup__message:empty {
    display: none;
}

#main-popup .main-popup__message.is-error {
    color: #dc2626;
}

#main-popup .main-popup__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 4px 0 14px;
}

#main-popup .main-popup__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 13px 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #0070f3 0%, #0051c7 100%);
    box-shadow: 0 6px 18px rgba(0, 112, 243, 0.3);
    color: #ffffff;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#main-popup .main-popup__submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 112, 243, 0.36);
}

#main-popup .main-popup__submit:disabled {
    cursor: progress;
    opacity: 0.75;
    transform: none;
}

#main-popup .main-popup__success {
    padding: 12px 16px;
    border: 1px solid #a7f3d0;
    border-radius: 10px;
    background: #ecfdf3;
    color: #166534;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

#main-popup .main-popup__proof {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    color: #334155;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

#main-popup .main-popup__stars {
    color: #f59e0b;
    font-size: 12px;
    letter-spacing: 1px;
}

#main-popup .main-popup__trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.4;
}

#main-popup .main-popup__trust svg {
    flex-shrink: 0;
    color: #10b981;
}

@media (max-width: 480px) {
    #main-popup .main-popup__card {
        padding: 28px 20px 24px;
    }
}
