/* MBAM Portal CSS */
.mbam-portal-wrapper {
    max-width: 900px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #333;
}

/* --- Global Utilities & Typography --- */
.mbam-gradient-text {
    background: linear-gradient(135deg, #2D3748, #4A5568);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- General Components --- */
.mbam-card {
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.mbam-btn {
    padding: 12px 20px;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.mbam-btn-primary {
    background-color: #2D3748;
    color: #fff;
}

.mbam-btn-primary:hover {
    background-color: #1A202C;
    transform: translateY(-1px);
}

.mbam-btn-block {
    width: 100%;
}

.mbam-button-generate {
    background: linear-gradient(135deg, #e5a953, #d4953c);
    color: #fff;
}

.mbam-button-generate:hover {
    background: linear-gradient(135deg, #d4953c, #c08229);
}

/* --- Forms --- */
.mbam-form-group {
    margin-bottom: 20px;
}

.mbam-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #4A5568;
}

.mbam-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background-color: #F7FAFC;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 15px;
    box-sizing: border-box;
}

.mbam-input:focus {
    outline: none;
    border-color: #A0AEC0;
    box-shadow: 0 0 0 3px rgba(160, 174, 192, 0.2);
    background-color: #fff;
}

/* --- Messages --- */
.mbam-status-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.mbam-status-message.error {
    background-color: #FFF5F5;
    color: #C53030;
    border: 1px solid #FEB2B2;
}

.mbam-status-message.success {
    background-color: #F0FFF4;
    color: #2F855A;
    border: 1px solid #9AE6B4;
}

/* --- Custom Frontend Login Screen --- */
.mbam-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 20px;
    background-color: #fcfcfc;
}

.mbam-login-container {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(0,0,0,0.04);
}

.mbam-login-header {
    text-align: center;
    margin-bottom: 30px;
}

.mbam-login-header h2 {
    margin: 0 0 8px 0;
    font-size: 26px;
    font-weight: 700;
}

.mbam-login-header p {
    margin: 0;
    color: #718096;
    font-size: 15px;
}

.mbam-form-footer {
    margin-top: 24px;
}

.mbam-login-help {
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

.mbam-forgot-link {
    color: #718096;
    text-decoration: none;
    transition: color 0.2s;
}

.mbam-forgot-link:hover {
    color: #2D3748;
    text-decoration: underline;
}

/* --- Portal App Shell (Sidebar Layout) --- */
.mbam-app-shell {
    display: flex;
    min-height: calc(100vh - 120px);
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    gap: 0;
}

/* ─── Sidebar ─────────────────────────────────────────── */
.mbam-sidebar {
    width: 240px;
    min-width: 240px;
    background: #1A202C;
    color: #E2E8F0;
    display: flex;
    flex-direction: column;
    border-radius: 16px 0 0 16px;
    padding: 28px 0 20px 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
}

.mbam-sidebar-brand {
    padding: 0 20px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
}

.mbam-sidebar-greeting {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #A0AEC0;
    font-weight: 500;
}

.mbam-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
}

.mbam-sidebar-resources {
    margin-top: 32px;
    padding: 0 12px;
}

.mbam-sidebar-resources-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #718096;
    margin: 0 0 12px 14px;
}

.mbam-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 8px;
    text-decoration: none;
    color: #A0AEC0;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.18s ease;
}

.mbam-nav-item:hover {
    background: rgba(255,255,255,0.07);
    color: #E2E8F0;
    text-decoration: none;
}

.mbam-nav-item.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.mbam-nav-icon {
    font-size: 17px;
    line-height: 1;
    min-width: 22px;
    text-align: center;
}

.mbam-nav-label {
    line-height: 1.3;
}

.mbam-sidebar-footer {
    padding: 16px 20px 0 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: auto;
}

.mbam-logout-link {
    font-size: 13px;
    color: #718096;
    text-decoration: none;
    transition: color 0.2s;
}

.mbam-logout-link:hover {
    color: #E2E8F0;
    text-decoration: none;
}

/* ─── Main Content ────────────────────────────────────── */
.mbam-main-content {
    flex: 1;
    background: #F7FAFC;
    border-radius: 0 16px 16px 0;
    padding: 36px 40px;
    overflow-y: auto;
}

@media (max-width: 900px) {
    .mbam-app-shell {
        flex-direction: column !important;
        min-height: auto !important;
        background: #F7FAFC !important;
        display: flex !important;
    }

    .mbam-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        border-radius: 0 !important;
        padding: 0 !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        background: #1A202C !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 9999 !important;
        height: auto !important;
    }

    .mbam-sidebar-brand {
        display: none !important;
    }

    /* Wrap nav sets to keep them clean */
    .mbam-sidebar-nav, .mbam-sidebar-resources {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        padding: 8px 10px !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 4px !important;
        margin: 0 !important;
        border: none !important;
        scrollbar-width: none !important;
    }
    
    .mbam-sidebar-nav::-webkit-scrollbar, .mbam-sidebar-resources::-webkit-scrollbar {
        display: none !important;
    }

    .mbam-sidebar-resources {
        padding-top: 0 !important;
        border-top: 1px solid rgba(255,255,255,0.05) !important;
        background: rgba(0,0,0,0.2) !important;
    }

    .mbam-sidebar-resources-title {
        display: none !important;
    }

    .mbam-nav-item {
        flex: 0 0 auto !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 8px 12px !important;
        font-size: 10px !important;
        text-align: center !important;
        min-width: 65px !important;
        border-radius: 6px !important;
        background: transparent !important;
        color: #A0AEC0 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .mbam-nav-item.active {
        color: #fff !important;
        background: rgba(255,255,255,0.1) !important;
        box-shadow: inset 0 -2px 0 #fff !important;
    }

    .mbam-nav-icon {
        font-size: 18px !important;
        margin: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .mbam-nav-icon svg {
        width: 20px !important;
        height: 20px !important;
    }

    .mbam-nav-label {
        font-weight: 700 !important;
        display: block !important;
        line-height: 1 !important;
    }

    .mbam-sidebar-footer {
        position: absolute !important;
        top: 8px !important;
        right: 10px !important;
        padding: 0 !important;
        border: none !important;
        margin: 0 !important;
        z-index: 10000 !important;
    }

    .mbam-logout-link {
        color: #fff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 32px !important;
        height: 32px !important;
        background: rgba(255,255,255,0.1) !important;
        border-radius: 50% !important;
        font-size: 0 !important; /* Hide "Log Out" text */
    }
    
    .mbam-logout-link svg {
        width: 16px !important;
        height: 16px !important;
        margin: 0 !important;
    }

    .mbam-main-content {
        padding: 15px !important;
        border-radius: 0 !important;
        background: #F7FAFC !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .mbam-view-header {
        margin-bottom: 20px !important;
        text-align: center !important;
    }

    .mbam-view-header h2 {
        font-size: 20px !important;
    }

    /* Form & Accordion tweaks for small screens */
    .mbam-accordion-header {
        padding: 12px 16px !important;
    }
    
    .mbam-accordion-header h3 {
        font-size: 14px !important;
    }

    .mbam-task-card {
        padding: 12px !important;
        margin-bottom: 10px !important;
    }
}

.mbam-view-header {
    margin-bottom: 28px;
}

.mbam-view-header h2 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 700;
    color: #1A202C;
}

.mbam-view-header p {
    margin: 0;
    color: #718096;
    font-size: 15px;
}

/* ─── Task Cards ──────────────────────────────────────── */
.mbam-task-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 14px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

a.mbam-task-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
    border-color: #CBD5E0;
}

.mbam-task-card.mbam-task-done {
    background: #F0FFF4;
    border-color: #9AE6B4;
}

.mbam-task-card.mbam-task-done .mbam-task-icon-svg {
    color: #2F855A;
}

.mbam-task-card.mbam-task-todo {
    border-left: 4px solid #E5A953;
}

.mbam-task-card.mbam-task-todo .mbam-task-icon-svg {
    color: #D69E2E;
}

.mbam-task-icon {
    font-size: 28px;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mbam-task-icon-svg {
    width: 26px;
    height: 26px;
}

.mbam-task-card > div {
    flex: 1;
}

.mbam-task-card > div strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1A202C;
    margin-bottom: 4px;
}

.mbam-task-card > div p {
    margin: 0;
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
}

.mbam-task-arrow {
    font-size: 20px;
    color: #A0AEC0;
}

/* ─── Checklist Section Label ─────────────────────────── */
.mbam-section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #A0AEC0;
    margin: 0 0 12px 2px;
}

/* ─── Task Badges ─────────────────────────────────────── */
.mbam-badge-done,
.mbam-badge-todo,
.mbam-badge-optional {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 7px;
    border-radius: 20px;
    vertical-align: middle;
    margin-left: 6px;
}

.mbam-badge-done {
    background: #C6F6D5;
    color: #276749;
}

.mbam-badge-todo {
    background: #FEEBC8;
    color: #7B341E;
}

.mbam-badge-optional {
    background: #E2E8F0;
    color: #718096;
}

/* ─── Resource Grid ───────────────────────────────────── */
.mbam-resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 4px;
}

.mbam-resource-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    padding: 24px 16px;
    text-decoration: none;
    color: #2D3748;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.18s ease;
}

.mbam-resource-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    text-decoration: none;
    color: #1A202C;
}

.mbam-resource-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4A5568;
}

.mbam-resource-icon .mbam-icon {
    width: 32px;
    height: 32px;
}

.mbam-resource-card strong {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.mbam-resource-card span {
    font-size: 11px;
    color: #A0AEC0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ─── Vows Textarea ───────────────────────────────────── */
.mbam-vows-textarea {
    width: 100%;
    min-height: 320px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.8;
    padding: 20px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    resize: vertical;
    box-sizing: border-box;
    color: #2D3748;
    background-color: #FDFAF6;
}

.mbam-vows-textarea:focus {
    outline: none;
    border-color: #A0AEC0;
    box-shadow: 0 0 0 3px rgba(160,174,192,0.2);
}

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
    .mbam-app-shell {
        flex-direction: column;
    }
    .mbam-sidebar {
        width: 100%;
        min-width: unset;
        border-radius: 16px 16px 0 0;
        padding: 20px 0 12px 0;
    }
    .mbam-sidebar-nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 0 12px;
    }
    .mbam-nav-item {
        flex: 1;
        min-width: 100px;
        justify-content: center;
        padding: 10px 8px;
        font-size: 12px;
    }
    .mbam-nav-label { display: none; }
    .mbam-nav-icon { font-size: 22px; }
    .mbam-main-content {
        border-radius: 0 0 16px 16px;
        padding: 24px 20px;
    }
}

/* Legacy grid (kept for backwards compat) */
.mbam-portal-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 24px;
}
@media (max-width: 768px) {
    .mbam-portal-grid { grid-template-columns: 1fr; }
}

/* ─── PDF Viewer ──────────────────────────────────────── */
.mbam-pdf-viewer {
    display: flex;
    flex-direction: column;
}

.mbam-pdf-frame {
    width: 100%;
    height: 720px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    background: #f8f8f8;
}

@media (max-width: 768px) {
    .mbam-pdf-frame { height: 480px; }
}

/* ─── NOIM Form Sections ──────────────────────────────── */
.mbam-noim-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mbam-noim-header {
    margin-bottom: 28px;
}

.mbam-noim-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #1A202C;
    margin: 0 0 8px 0;
}

.mbam-noim-header p {
    color: #718096;
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Each section = its own visible card */
.mbam-form-section {
    background: #ffffff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Coloured header strip for each section */
.mbam-section-heading {
    background: #2D3748;
    color: #ffffff;
    margin: 0;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
    border-bottom: 3px solid rgba(255,255,255,0.1);
}

/* Accent colour for Partner 1 section */
.mbam-form-section:nth-child(2) .mbam-section-heading {
    background: #2B6CB0;
}

/* Accent colour for Partner 2 section */
.mbam-form-section:nth-child(3) .mbam-section-heading {
    background: #2C7A7B;
}

/* Accent colour for Relationship section */
.mbam-form-section:nth-child(4) .mbam-section-heading {
    background: #44337A;
}

/* Form body padding inside each card */
.mbam-form-section > *:not(.mbam-section-heading) {
    padding-left: 24px;
    padding-right: 24px;
}

.mbam-form-section > .mbam-form-group:first-of-type,
.mbam-form-section > h4:first-of-type,
.mbam-form-section > .mbam-form-row:first-of-type {
    padding-top: 20px;
}

.mbam-form-section > *:last-child {
    padding-bottom: 24px;
}

/* --- Legal Handling Options UI Overhaul --- */
.mbam-legal-options {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Strict 2x2 */
    gap: 20px;
    margin: 24px 0 40px;
}

@media (max-width: 768px) {
    .mbam-legal-options {
        grid-template-columns: 1fr;
    }
}

.mbam-legal-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #ffffff;
    border: 2px solid #E2E8F0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.mbam-legal-card:hover {
    border-color: #CBD5E0;
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.mbam-legal-card.is-selected {
    border-color: #2D3748; /* Dark, bold border */
    border-width: 3px;
    background-color: #ffffff;
    box-shadow: 0 0 0 1px #2D3748, 0 10px 15px -3px rgba(45, 55, 72, 0.1);
}

.mbam-legal-card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mbam-legal-card-title {
    font-weight: 700;
    font-size: 15px;
    color: #1A202C;
    line-height: 1.3;
    padding-right: 30px;
}

.mbam-legal-badge {
    background: #FEEBC8;
    color: #9C4221;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.mbam-legal-desc {
    font-size: 13px;
    color: #4A5568;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.mbam-legal-flow-box {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 0.9rem;
    color: #2D3748;
    margin-bottom: 16px;
}

.mbam-legal-flow-steps {
    margin-top: 10px;
    padding-left: 5px;
}

.mbam-legal-flow-step {
    position: relative;
    padding-left: 20px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.mbam-legal-flow-step::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #CBD5E0;
    font-weight: bold;
}

.mbam-legal-flow-step .mbam-legal-highlight-start,
.mbam-legal-flow-step .mbam-legal-highlight-end {
    background: #FEF3C7; /* Requested yellow highlight */
    padding: 2px 0;
    margin: 0 -16px; /* Offset parent padding if any */
    padding-left: 16px;
    padding-right: 16px;
    display: block;
    width: calc(100% + 32px);
}

.mbam-legal-flow-step:has(.mbam-legal-marker) {
    list-style: none !important;
    padding-left: 0 !important;
    margin-top: 4px !important;
    margin-bottom: 4px !important;
}

.mbam-legal-flow-step:has(.mbam-legal-marker)::before {
    content: none !important;
}

.mbam-legal-marker {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #48BB78; /* Premium green */
    font-weight: 700;
    font-style: italic;
    font-size: 14px;
    margin-left: 20px;
    position: relative;
    font-family: 'Handwriting', cursive, sans-serif; /* Fallback to handwriting vibe */
}

.mbam-no-arrow::before {
    content: none !important;
}

.mbam-no-arrow .mbam-legal-arrow {
    display: none !important;
}

.mbam-legal-arrow {
    width: 24px;
    height: 24px;
    transform: rotate(90deg); /* Point up/towards the flow */
    color: #48BB78;
}

.mbam-legal-flow-box strong {
    color: #1A202C;
}

.mbam-legal-result {
    font-size: 12px;
    color: #718096;
    border-top: 1px solid #EDF2F7;
    padding-top: 12px;
}

.mbam-legal-card.recommended {
    border-left: 4px solid #ecc94b;
}

/* --- Sub-headings inside a section --- */
.mbam-sub-heading {
    font-size: 13px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px 0;
    padding-top: 16px;
    border-top: 1px solid #EDF2F7;
}

.mbam-form-section h4.mbam-sub-heading:first-of-type {
    border-top: none;
    padding-top: 20px;
}

/* Declaration section */
.mbam-noim-declaration {
    background: #FFFBEB;
    border-color: #F6E05E;
}

.mbam-noim-declaration .mbam-section-heading {
    background: #B7791F;
}

.mbam-noim-declaration p {
    margin: 0;
    font-size: 13px;
    color: #744210;
    line-height: 1.6;
    padding: 16px 24px 20px;
}

/* Submit button below the cards */
#mbam-noim-submit {
    width: 100%;
    margin-top: 4px;
    padding: 15px 24px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #2D3748, #4A5568);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

#mbam-noim-submit:hover {
    background: linear-gradient(135deg, #1A202C, #2D3748);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 55, 72, 0.3);
}

/* Forms inside sections — override wrapper max-width padding */
.mbam-noim-wrapper .mbam-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
    color: #4A5568;
}

.mbam-noim-wrapper .mbam-form-group input,
.mbam-noim-wrapper .mbam-form-group select,
.mbam-noim-wrapper .mbam-form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    background: #F7FAFC;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mbam-noim-wrapper .mbam-form-group input:focus,
.mbam-noim-wrapper .mbam-form-group select:focus {
    outline: none;
    border-color: #A0AEC0;
    box-shadow: 0 0 0 3px rgba(160, 174, 192, 0.2);
    background: #fff;
}

.mbam-noim-wrapper .mbam-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}

.mbam-noim-wrapper .mbam-form-group .required {
    color: #E53E3E;
}

.mbam-noim-wrapper .mbam-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

@media (max-width: 600px) {
    .mbam-noim-wrapper .mbam-form-row {
        grid-template-columns: 1fr;
    }

    .mbam-form-section > *:not(.mbam-section-heading) {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* --- Website Menu Button Integration --- */
/* Force the Astra Header Builder "Center" section to fill available space */
.site-header-primary-section-center {
    flex: 1 !important;
    display: flex !important;
    justify-content: flex-start !important;
}

/* Ensure the menu component wrapper also takes full width */
.ast-builder-menu-1 {
    width: 100% !important;
}

/* Force the menu list to be a full-width flexbox */
.main-header-menu {
    display: flex !important;
    width: 100% !important;
    justify-content: flex-start !important;
}

/* Finally, push the Login/Portal button to the far right within that expanded container */
.main-header-menu .menu-item.mbam-menu-item-button {
    display: flex !important;
    align-items: center !important;
    padding-left: 15px !important;
    margin-left: auto !important; /* The magic sauce */
}

/* Base link styling with high specificity */
.main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button,
.main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button:link,
.main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button:visited {
    display: inline-block !important;
    padding: 8px 20px !important;
    background-color: #1a4a5e !important; /* Premium dark teal/blue */
    color: #ffffff !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    line-height: 1 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin: 5px 0 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button:hover,
.main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button:active {
    background-color: #245d75 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
}

/* Adjust for Astra Header Builder mobile compatibility */
@media (max-width: 991px) {
    .main-header-menu .menu-item.mbam-menu-item-button {
        padding: 15px 20px !important;
        display: block !important;
        text-align: center !important;
    }
    .main-header-menu .menu-item.mbam-menu-item-button a.mbam-menu-button {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* --- Accordion Styles (Mate Questionnaire) --- */
.mbam-accordion {
    margin-bottom: 30px;
}

.mbam-accordion-item {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.mbam-accordion-header {
    padding: 18px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    user-select: none;
    transition: background 0.2s ease;
}

.mbam-accordion-header:hover {
    background: #F7FAFC;
}

.mbam-accordion-header h3 {
    margin: 0 !important;
    font-size: 16px;
    font-weight: 600;
    color: #2D3748;
}

.mbam-accordion-content {
    padding: 0 24px 24px 24px;
    display: none; /* Hidden by default */
    border-top: 1px solid #EDF2F7;
}

.mbam-accordion-icon {
    width: 20px;
    height: 20px;
    color: #A0AEC0;
    transition: transform 0.3s ease;
}

.mbam-accordion-item.is-open .mbam-accordion-icon {
    transform: rotate(180deg);
}

.mbam-accordion-item.is-open {
    border-color: #CBD5E0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
