.bbp-nda-modal-open {
    /* Prevent background page scroll but do NOT use overflow:hidden on body on iOS
       because that breaks position:fixed elements and prevents the dialog from scrolling.
       Instead we rely on overscroll-behavior on the dialog itself. */
    overflow: hidden;
    /* iOS Safari: prevent body from scrolling behind modal */
    touch-action: none;
}

.bbp-nda-flow-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    /* Allow the modal container itself to scroll on iOS so the dialog is reachable */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bbp-nda-flow-modal.is-open {
    display: block;
}

.bbp-nda-flow-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.bbp-nda-flow-dialog {
    position: relative;
    z-index: 2;
    width: min(1100px, calc(100vw - 40px));
    /* Use dvh (dynamic viewport height) so the dialog shrinks when the mobile keyboard opens.
       Fall back to svh then 100vh for browsers that don't support dvh. */
    max-height: calc(100vh - 40px);
    max-height: calc(100svh - 40px);
    max-height: calc(100dvh - 40px);
    margin: 20px auto;
    padding: 24px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Prevent scroll chaining to the page behind */
    overscroll-behavior: contain;
}

.bbp-nda-flow-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.bbp-nda-flow-header {
    margin-bottom: 16px;
}

.bbp-nda-flow-header h2 {
    margin: 0;
}

.bbp-nda-flow-header p {
    margin: 6px 0 0;
    color: #54595f;
}

.bbp-nda-flow-message {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 6px;
    background: #f3f4f6;
    color: #111;
}

.bbp-nda-flow-message.is-error {
    background: #fee2e2;
    color: #991b1b;
}

.bbp-nda-flow-message.is-success {
    background: #dcfce7;
    color: #166534;
}

.bbp-nda-flow-loader {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.78);
    font-weight: 600;
    color: #1f2937;
    border-radius: 12px;
}

.bbp-nda-flow-loader-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: bbp-nda-spin 0.8s linear infinite;
}

@keyframes bbp-nda-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.bbp-nda-inline-note {
    margin-bottom: 12px;
}

.bbp-nda-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 14px;
}

.bbp-nda-tab {
    border: 0;
    background: transparent;
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 600;
    color: #4b5563;
}

.bbp-nda-tab.is-active {
    color: #111827;
    border-bottom: 2px solid #111827;
}

.bbp-nda-tab-panel {
    display: none;
    margin-bottom: 20px;
}

.bbp-nda-tab-panel.is-active {
    display: block;
}

.bbp-nda-flow-actions {
    margin-top: 16px;
}

.bbp-auth-form {
    margin-top: 8px;
}

.bbp-social-auth {
    margin: 8px 0 6px;
}

.bbp-social-auth-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.bbp-auth-divider {
    display: flex;
    align-items: center;
    margin: 8px 0 10px;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bbp-auth-divider::before,
.bbp-auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.bbp-auth-divider span {
    padding: 0 10px;
}

.bbp-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.bbp-field-grid-two {
    grid-template-columns: 1fr 1fr;
}

.bbp-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bbp-field-full {
    grid-column: 1 / -1;
}

.bbp-field label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.bbp-required {
    color: #b91c1c;
    font-weight: 600;
    font-size: 14px;
    margin-left: 2px;
}

.bbp-password-hint {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.bbp-field input,
.bbp-field textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
}

.bbp-field input:focus,
.bbp-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.bbp-nda-file-viewer iframe {
    width: 100%;
    height: 58vh;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
}

.bbp-nda-sign-form {
    margin-top: 16px;
}

.bbp-nda-sign-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.bbp-nda-sign-form input[type="text"] {
    width: 100%;
    max-width: 460px;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.bbp-nda-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.bbp-business-file-list {
    margin: 0 0 14px;
    padding-left: 18px;
}

.bbp-business-file-list li {
    margin-bottom: 6px;
}

.bbp-business-fullscreen-btn {
    margin-bottom: 10px;
}

.bbp-business-cta-wrap {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

.bbp-business-cta-note {
    margin: 0 0 10px;
    font-size: 13px;
    color: #475569;
    text-align: center;
}

.bbp-business-cta-btn {
    min-width: 220px;
}

.bbp-direct-message-btn {
    margin-top: 10px;
}

.property-banner .property-form-wrap {
    z-index: 5 !important;
    pointer-events: auto;
}

.property-banner .property-banner-trigger {
    z-index: 1;
}

.bbp-nda-flow-modal.is-loading .bbp-nda-flow-dialog {
    opacity: 0.7;
    pointer-events: none;
}

@media (max-width: 767px) {
    .bbp-nda-flow-modal {
        /* On mobile the modal wrapper handles the full-screen scroll area */
        align-items: flex-start;
    }

    .bbp-nda-flow-dialog {
        width: calc(100vw - 20px);
        margin: 10px auto;
        /* dvh cascade for mobile keyboard awareness */
        max-height: calc(100vh - 20px);
        max-height: calc(100svh - 20px);
        max-height: calc(100dvh - 20px);
        padding: 16px;
        /* Ensure inputs are reachable above the keyboard on small screens */
        padding-bottom: env(safe-area-inset-bottom, 16px);
    }

    .bbp-nda-file-viewer iframe {
        height: 50vh;
    }

    .bbp-field-grid-two {
        grid-template-columns: 1fr;
    }

    /* Ensure form inputs in modal are focusable and scrollable to on mobile */
    .bbp-nda-flow-modal .bbp-field input,
    .bbp-nda-flow-modal .bbp-field textarea,
    .bbp-nda-sign-form input[type="text"],
    .bbp-nda-sign-form input[type="tel"] {
        font-size: 16px;
        /* Prevents iOS auto-zoom on input focus */
        touch-action: manipulation;
    }
}

/* Special Fix for Access Business Details Now popup when opened in mobile by clicking the Email icon on phone */

@media (max-width: 767px) {
    .modal-open.bbp-nda-modal-open .modal.fade.mobile-property-form.show {
        display: none !important;
    }
}