/* ══ Service Popup ══ */

/* ── Overlay ── */
.nml-svc__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(11, 16, 31, 0.56);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nml-svc__overlay--visible {
    opacity: 1;
}

/* ── Dialog ── */
/* This element owns the popup's scroll, so it must stay hit-testable: with
   pointer-events:none a touch that lands on its padding falls through to the
   page behind, which then scrolls instead of the popup. Clicking the empty area
   still closes the popup — handled in script.js (e.target === dialog), not by
   letting the click through to the overlay underneath. */
.nml-svc__dialog {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 40px 24px;
}

.nml-svc__dialog:not([hidden]) {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* ── Inner ── */
.nml-svc__inner {
    position: relative;
    width: 100%;
    max-width: 1064px;
    margin: auto;
    background: var(--color-bg);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0px 1px 2px 0px #4C83F333;
    border: 2px solid #889CF1;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(24px) scale(0.98);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.nml-svc__dialog--open .nml-svc__inner {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── Close ── */
.nml-svc__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: #303D60;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.nml-svc__close:hover {
    background: #EEF0FD;
    color: #0B101F;
}

/* ── Title ── */
.nml-svc__title {
    margin: 0 0 32px;
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
    color: var(--color-text-primary);
    text-align: center; 
}

.nml-svc__title-accent {
    color: #FF4171;
}

/* ── Wrapper: card | divider | card ── */
.nml-svc__wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    align-items: stretch;
}

/* ── Cards ── */
.nml-svc__card {
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    background: var(--color-bg);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(76, 131, 243, 0.12);
    border: 1.5px solid var(--color-line);
}

.nml-svc__card-title {
    margin: 0 0 8px 0;
    font-size: 24px;
    line-height: 32px;
    font-weight: 700;
    color: var(--color-text-primary);
}

.nml-svc__card-text {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* horizontal rule under email description */
.nml-svc__rule {
    border: none;
    border-top: 1px solid var(--color-line);
    margin: 20px 0;
}

/* ── Form fields ── */
.nml-svc__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nml-svc__textarea {
    min-height: 200px;
    resize: vertical;
}

/* ── Card footer (button + response time) ── */
.nml-svc__card-footer {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: auto;
    padding-top: 8px;
    flex-wrap: wrap;
}

.nml-svc__card-footer--wa {
    margin-top: auto;
}

.nml-svc__response-time {
    font-size: 14px;
    font-weight: 600;
    color: #FF4171;
}

/* ── Email submit button ── */
.nml-svc__submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 26px;
    border: 1.5px solid #C9D3FB;
    border-radius: 10px;
    background: #fff;
    color: #0B101F;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, opacity 0.2s;
}

.nml-svc__submit-btn:hover {
    border-color: #889CF1;
    background: #F5F6FA;
}

.nml-svc__submit-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.nml-svc__btn-icon {
    flex-shrink: 0;
    color: #162F6F;
}

/* ── WhatsApp button ── */
.nml-svc__wa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 26px;
    border: 1.5px solid #C9D3FB;
    border-radius: 10px;
    background: #fff;
    color: #0B101F;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.nml-svc__wa-btn:hover {
    border-color: #25D366;
    background: #F4FBF6;
}

.nml-svc__wa-btn .nml-svc__btn-icon {
    color: #25D366;
}

/* ── WhatsApp illustration ── */
.nml-svc__wa-media {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #4CAF500A;
    border: 1px solid #4CAF5080;
    box-shadow: 0px 1px 2px 0px #4C83F333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.nml-svc__wa-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ── Divider with "or" ── */
.nml-svc__divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
}

.nml-svc__divider::before {
    content: "";
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 50%;
    width: 1px;
    background: #C9D3FB;
}

.nml-svc__divider-label {
    position: relative;
    z-index: 1;
    padding: 6px 0;
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: #8A9BCF;
}

/* ── Spinner ── */
.nml-svc__btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(22, 47, 111, 0.3);
    border-top-color: #162F6F;
    border-radius: 50%;
    animation: nml-svc-spin 0.7s linear infinite;
}

.nml-svc__submit-btn--loading .nml-svc__btn-spinner {
    display: inline-block;
}

.nml-svc__submit-btn--loading .nml-svc__btn-icon {
    display: none;
}

@keyframes nml-svc-spin {
    to { transform: rotate(360deg); }
}

/* ── Status message ── */
.nml-svc__status {
    margin: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.nml-svc__status--error {
    background: #FDECF1;
    color: #C2274F;
}

.nml-svc__status--success {
    background: #E7F7EF;
    color: #1E7F4E;
}

/* Reserve no space until a message is shown (overrides .nml-alert display:flex) */
.nml-svc__status[hidden] { display: none; }
.nml-svc__status:not([hidden]) { display: flex; }

/* ══ Responsive ══ */
@media (max-width: 980px) {
    .nml-svc__inner {
        padding: 32px 24px;
    }

    .nml-svc__title {
        font-size: 30px;
        margin-bottom: 28px;
    }

    .nml-svc__wrap {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    /* divider becomes a horizontal line between stacked cards */
    .nml-svc__divider {
        width: 100%;
        height: 24px;
    }

    .nml-svc__divider::before {
        top: 50%;
        bottom: auto;
        left: 12px;
        right: 12px;
        width: auto;
        height: 1px;
        transform: translateY(-50%);
    }

    .nml-svc__divider-label {
        padding: 0 12px;
    }

    .nml-svc__textarea {
        min-height: 140px;
    }
}

@media (max-width: 560px) {
    .nml-svc__dialog {
        padding: 16px;
        align-items: flex-start;
    }

    .nml-svc__card {
        padding: 22px 20px;
    }

    .nml-svc__card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .nml-svc__submit-btn,
    .nml-svc__wa-btn {
        width: 100%;
    }

    .nml-svc__response-time {
        text-align: center;
    }
}
