/* ==========================================
   NARESH ENGINEERING CORPORATION
   SITE WIDGETS
   1. Inquiry popup (auto-opens after 5s)
   2. Floating "Contact Us" button (bottom right)
   3. Web3Forms status messages
========================================== */


/* ==========================================
   1. INQUIRY POPUP
========================================== */

#necInquiryPopup,
#necInquiryPopup * {
    box-sizing: border-box;
}

#necInquiryPopup {
    position: fixed;
    inset: 0;
    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(9, 19, 43, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

#necInquiryPopup.nec-popup-active {
    opacity: 1;
    visibility: visible;
}

.nec-popup-box {
    position: relative;

    display: grid;
    grid-template-columns: 0.88fr 1.12fr;

    width: 100%;
    max-width: 850px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;

    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);

    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s ease;

    font-family: Arial, sans-serif;
}

.nec-popup-active .nec-popup-box {
    transform: translateY(0) scale(1);
}

/* Left panel */

.nec-popup-left {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 45px 30px;

    background: #233e9d;
    color: #ffffff;
}

.nec-popup-tag {
    display: block;
    margin-bottom: 22px;

    color: #c8d7ff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 1.2px;
}

.nec-popup-left h2 {
    margin: 0 0 17px;

    color: #ffffff;
    font-family: "League Spartan", Arial, sans-serif;
    font-size: 29px;
    font-weight: 700;
    line-height: 1.3;
}

.nec-popup-left p {
    margin: 0;

    color: #e5ebff;
    font-size: 14px;
    line-height: 1.8;
}

.nec-popup-contact {
    margin-top: 35px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.nec-popup-contact span {
    display: block;
    margin-bottom: 7px;

    color: #c8d7ff;
    font-size: 12px;
}

.nec-popup-contact a {
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
}

.nec-popup-contact a:hover {
    text-decoration: underline;
}

/* Right panel */

.nec-popup-right {
    padding: 36px 34px 30px;
    background: #ffffff;
}

.nec-popup-right h3 {
    margin: 0 35px 7px 0;

    color: #17233b;
    font-family: "League Spartan", Arial, sans-serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.35;
}

.nec-popup-subtitle {
    margin: 0 0 22px;

    color: #727b89;
    font-size: 13px;
}

.nec-popup-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.nec-popup-field {
    min-width: 0;
    margin-bottom: 15px;
}

.nec-popup-field label {
    display: block;
    margin-bottom: 7px;

    color: #243b5b;
    font-family: "League Spartan", Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
}

.nec-popup-field input,
.nec-popup-field textarea {
    display: block;

    width: 100%;
    min-width: 0;

    padding: 11px 12px;

    color: #202b3d;
    background: #ffffff;

    border: 1px solid #dce1e9;
    border-radius: 6px;

    font-family: Arial, sans-serif;
    font-size: 13px;

    outline: none;
    box-shadow: none;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.nec-popup-field input {
    height: 42px;
}

.nec-popup-field textarea {
    min-height: 75px;
    resize: vertical;
}

.nec-popup-field input:focus,
.nec-popup-field textarea:focus {
    border-color: #2943a7;
    box-shadow: 0 0 0 3px rgba(41, 67, 167, 0.09);
}

.nec-popup-field input::placeholder,
.nec-popup-field textarea::placeholder {
    color: #9aa1ac;
}

#necPopupSubmit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    width: 100%;
    min-height: 45px;
    padding: 12px 18px;

    color: #ffffff;
    background: #2943a7;

    border: none;
    border-radius: 6px;

    font-family: "League Spartan", Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;

    cursor: pointer;

    transition: background-color 0.2s;
}

#necPopupSubmit:hover {
    background: #172d7d;
}

#necPopupSubmit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Close button */

.nec-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;
    padding: 0;

    color: #26334c;
    background: #f0f2f7;

    border: none;
    border-radius: 50%;

    font-size: 26px;
    line-height: 1;

    cursor: pointer;
}

.nec-popup-close:hover {
    background: #e1e6f1;
}

@media (max-width: 650px) {

    #necInquiryPopup {
        padding: 12px;
    }

    .nec-popup-box {
        display: block;
        max-width: 430px;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 10px;
    }

    .nec-popup-left {
        padding: 25px 22px 20px;
    }

    .nec-popup-tag {
        margin-bottom: 10px;
        padding-right: 28px;
        font-size: 9px;
    }

    .nec-popup-left h2 {
        max-width: 320px;
        margin-bottom: 8px;
        font-size: 23px;
    }

    .nec-popup-left p {
        font-size: 12px;
        line-height: 1.6;
    }

    .nec-popup-contact {
        margin-top: 14px;
        padding-top: 12px;
    }

    .nec-popup-contact a {
        font-size: 15px;
    }

    .nec-popup-right {
        padding: 22px;
    }

    .nec-popup-right h3 {
        font-size: 21px;
    }

    .nec-popup-subtitle {
        margin-bottom: 16px;
    }

    .nec-popup-field {
        margin-bottom: 12px;
    }

    /* Left panel's white close button sits on blue */
    .nec-popup-close {
        top: 10px;
        right: 10px;
        width: 30px;
        height: 30px;
        font-size: 22px;
    }

}

@media (max-width: 360px) {

    .nec-popup-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .nec-popup-left {
        padding: 22px 18px 17px;
    }

    .nec-popup-right {
        padding: 18px;
    }

}


/* ==========================================
   2. FLOATING CONTACT WIDGET
========================================== */

.nec-cw,
.nec-cw * {
    box-sizing: border-box;
}

.nec-cw {
    --cw-size: 56px;
    --cw-gap: 8px;

    position: fixed;
    right: 25px;
    bottom: 25px;
    z-index: 9990;

    width: var(--cw-size);

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Channel list (slides up above the trigger) */

.nec-cw-list {
    position: absolute;
    right: 0;
    bottom: calc(var(--cw-size) + var(--cw-gap));

    display: flex;
    flex-direction: column;
    gap: var(--cw-gap);

    margin: 0;
    padding: 0;

    list-style: none;

    pointer-events: none;
}

.nec-cw-list li {
    position: relative;

    opacity: 0;
    transform: translateY(20px) scale(0.6);

    transition:
        opacity 0.25s ease,
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Stagger: bottom item first */
.nec-cw-list li:nth-last-child(1) { transition-delay: 0s; }
.nec-cw-list li:nth-last-child(2) { transition-delay: 0.05s; }
.nec-cw-list li:nth-last-child(3) { transition-delay: 0.1s; }

.nec-cw.is-open .nec-cw-list {
    pointer-events: auto;
}

.nec-cw.is-open .nec-cw-list li {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Round buttons */

.nec-cw-btn,
.nec-cw-trigger {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--cw-size);
    height: var(--cw-size);

    padding: 0;

    color: #ffffff;
    border: 0;
    border-radius: 50%;

    box-shadow: 0 0 12px rgba(0, 0, 0, 0.3);

    text-decoration: none;

    cursor: pointer;

    transition: transform 0.2s ease, filter 0.2s ease;
}

.nec-cw-btn:hover,
.nec-cw-trigger:hover {
    transform: scale(1.06);
    filter: brightness(1.05);
}

.nec-cw-btn svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.nec-cw-whatsapp { background: #4dc247; }
.nec-cw-mail     { background: #f36d23; }
.nec-cw-phone    { background: #00bb70; }

.nec-cw-whatsapp svg {
    width: 32px;
    height: 32px;
}

/* Hover labels (left side) */

.nec-cw-btn::before,
.nec-cw-cta {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;

    padding: 6px 14px;

    color: #000000;
    background: #ffffff;

    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);

    font-size: 15px;
    line-height: 1.35;
    white-space: nowrap;

    transform: translateY(-50%);
}

.nec-cw-btn::before {
    content: attr(data-label);

    opacity: 0;
    visibility: hidden;

    transform: translate(6px, -50%);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;

    pointer-events: none;
}

/* Little arrow on the label */
.nec-cw-btn::after,
.nec-cw-cta::after {
    content: "";
    position: absolute;
    top: 50%;

    border: 6px solid transparent;
    border-left-color: #ffffff;
}

.nec-cw-btn::after {
    right: calc(100% + 2px);

    opacity: 0;
    visibility: hidden;

    transform: translate(6px, -50%);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        visibility 0.2s ease;
}

.nec-cw-cta::after {
    left: 100%;
    transform: translateY(-50%);
}

@media (hover: hover) {

    .nec-cw-btn:hover::before,
    .nec-cw-btn:focus-visible::before {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%);
    }

    .nec-cw-btn:hover::after,
    .nec-cw-btn:focus-visible::after {
        opacity: 1;
        visibility: visible;
        transform: translate(0, -50%);
    }

}

/* Trigger */

.nec-cw-trigger {
    background: #1c5fc6;
}

.nec-cw-trigger svg {
    position: absolute;
    top: 50%;
    left: 50%;

    transition:
        transform 0.3s ease,
        opacity 0.2s ease;
}

.nec-cw-icon-chat {
    width: 30px;
    height: 30px;
    transform: translate(-50%, -50%);
}

.nec-cw-icon-close {
    width: 22px;
    height: 22px;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-90deg);
}

.nec-cw.is-open .nec-cw-icon-chat {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

.nec-cw.is-open .nec-cw-icon-close {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0);
}

/* Shockwave pulse */

.nec-cw-trigger::before {
    content: "";
    position: absolute;
    inset: 0;

    border-radius: 50%;

    box-shadow: 0 0 0 0 rgba(28, 95, 198, 0.6);

    animation: nec-cw-shockwave 2.4s ease-out infinite;

    pointer-events: none;
}

.nec-cw.is-open .nec-cw-trigger::before {
    animation: none;
}

@keyframes nec-cw-shockwave {
    0%   { box-shadow: 0 0 0 0 rgba(28, 95, 198, 0.55); }
    70%  { box-shadow: 0 0 0 16px rgba(28, 95, 198, 0); }
    100% { box-shadow: 0 0 0 16px rgba(28, 95, 198, 0); }
}

/* "Contact Us" call-to-action bubble */

.nec-cw-cta {
    pointer-events: none;

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.nec-cw.is-open .nec-cw-cta {
    opacity: 0;
    visibility: hidden;
}

.nec-cw-trigger-wrap {
    position: relative;
}

/* Visually hidden helper */
.nec-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 689.98px) {

    .nec-cw {
        --cw-size: 52px;
        right: 16px;
        bottom: 16px;
    }

    .nec-cw-cta {
        font-size: 14px;
        padding: 5px 12px;
    }

}

/* Hide the widget while the mobile drawer or popup is open */
body.nec-nav-locked .nec-cw,
body.nec-popup-open .nec-cw {
    opacity: 0;
    visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {

    #necInquiryPopup,
    .nec-popup-box,
    .nec-cw *,
    .nec-cw *::before {
        transition: none !important;
        animation: none !important;
    }

}


/* ==========================================
   3. WEB3FORMS STATUS MESSAGE
========================================== */

.nec-form-status {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
}

.nec-form-status:empty {
    display: none;
}

.nec-form-status.is-success {
    color: #16803c;
}

.nec-form-status.is-error {
    color: #c62828;
}

form[data-web3form] button[type="submit"]:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}
