/* ==========================================================================
   Noles Group Guide Forms
   Measurements taken from the approved XD mockup (popup scaled up from the
   72.5% artboard view). Fonts inherit from the theme / Elementor globals.
   ========================================================================== */

:root {
    --mm-gdf-navy: #1C355E;
    --mm-gdf-tan: #C2AD92;
    --mm-gdf-tan-hover: #A8927A;
    --mm-gdf-plum: #57143F;
    --mm-gdf-plum-hover: #420E30;
    --mm-gdf-ink: #111;
}

/* ---------- Cards ---------- */

.mm-gdf-grid {
    display: grid;
    grid-template-columns: repeat(3, 357px);
    column-gap: 124px;
    row-gap: 56px;
    justify-content: center;
    margin: 0 auto;
}

.mm-gdf-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.mm-gdf-card-cover {
    width: 100%;
    margin-bottom: 20px;
}

.mm-gdf-grid .mm-gdf-card-title {
    margin: 0 0 8px;
    padding: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 20px;
    color: var(--mm-gdf-ink);
    /* Reserve two lines so descriptions and buttons line up across cards,
       matching the mockup where the one-line Tax Planning title still
       leaves its description level with the others. */
    min-height: 40px;
    text-wrap: balance;
}

.mm-gdf-grid .mm-gdf-card-description {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 18px;
    color: var(--mm-gdf-ink);
}

/* Theme and Elementor global button styles would otherwise win. */
.mm-gdf-grid .mm-gdf-card-btn {
    margin-top: auto;
    display: inline-block;
    padding: 8px 22px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--mm-gdf-tan) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mm-gdf-grid .mm-gdf-card-btn:hover,
.mm-gdf-grid .mm-gdf-card-btn:focus-visible {
    background: var(--mm-gdf-tan-hover) !important;
    color: #fff !important;
}

.mm-gdf-grid .mm-gdf-card-btn:focus-visible {
    outline: 2px solid var(--mm-gdf-navy);
    outline-offset: 3px;
}

.mm-gdf-admin-note,
.mm-gdf-empty {
    font-size: 13px;
    color: #b32d2e;
}

@media (max-width: 1380px) {
    .mm-gdf-grid {
        grid-template-columns: repeat(3, minmax(0, 357px));
        column-gap: 40px;
    }
}

@media (max-width: 767px) {
    .mm-gdf-grid {
        grid-template-columns: minmax(0, 357px);
        row-gap: 48px;
    }

    .mm-gdf-grid .mm-gdf-card-title {
        min-height: 0;
    }
}

/* ---------- Covers (image or pdf.js canvas) ---------- */

.mm-gdf-cover {
    position: relative;
    width: 100%;
}

.mm-gdf-cover img {
    display: block;
    width: 100%;
    height: auto;
}

.mm-gdf-cover--pdf {
    aspect-ratio: 259 / 334; /* holds space until the PDF renders */
    overflow: hidden;
    background: #f2f2f2;
}

.mm-gdf-cover--pdf.is-rendered {
    aspect-ratio: auto;
    background: none;
}

.mm-gdf-cover .pdf-thumbnail-canvas {
    display: block;
    width: 100%;
    height: auto;
}

.mm-gdf-cover .pdf-thumbnail-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.mm-gdf-cover .pdf-thumbnail-filename {
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ---------- Popup ---------- */

html.mm-gdf-lock,
html.mm-gdf-lock body {
    overflow: hidden;
}

.mm-gdf-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 22, 40, 0.6);
}

.mm-gdf-modal-overlay.is-active {
    display: flex;
}

.mm-gdf-modal-box {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 44px 50px;
    box-sizing: border-box;
    background: var(--mm-gdf-navy);
    color: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.mm-gdf-modal-box .mm-gdf-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0 !important;
    border: 0 !important;
    background: none !important;
    color: #fff !important;
    font-size: 28px !important;
    line-height: 1 !important;
    opacity: 0.8;
    cursor: pointer;
    box-shadow: none !important;
}

.mm-gdf-modal-box .mm-gdf-modal-close:hover,
.mm-gdf-modal-box .mm-gdf-modal-close:focus-visible {
    opacity: 1;
}

.mm-gdf-modal-box .mm-gdf-modal-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.mm-gdf-modal-content[hidden] {
    display: none !important;
}

.mm-gdf-modal-top {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.mm-gdf-modal-cover {
    flex: 0 0 240px;
}

.mm-gdf-modal-text {
    flex: 1 1 auto;
    min-width: 0;
}

.mm-gdf-modal-box .mm-gdf-modal-headline {
    margin: 0 0 20px;
    padding: 0;
    font-size: 28px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
    color: #fff;
    text-wrap: balance;
}

.mm-gdf-modal-box .mm-gdf-modal-subcopy {
    margin: 0;
    font-size: 18px;
    line-height: 1.5;
    color: #fff;
}

.mm-gdf-modal-form-wrap {
    margin-top: 56px;
}

/* ---------- WPForms inside the popup ----------
   Row spacing uses grid row-gap on the field container rather than field
   margins, since WPForms' own ID-scoped field CSS beats class selectors on
   margin (same fix as White Papers). Labels are visually hidden but kept for
   screen readers; set matching Placeholder Text on each field in WPForms. */

.mm-gdf-modal-form-wrap .wpforms-container {
    margin: 0 !important;
}

.mm-gdf-modal-form-wrap .wpforms-field-container {
    display: grid;
    row-gap: 14px;
}

.mm-gdf-modal-form-wrap .wpforms-field {
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
}

.mm-gdf-modal-form-wrap .wpforms-field-label,
.mm-gdf-modal-form-wrap .wpforms-field-sublabel {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Name field (First Last format): side by side, 20px apart */
.mm-gdf-modal-form-wrap .wpforms-field-name .wpforms-field-row {
    display: flex !important;
    gap: 20px;
    margin: 0 !important;
    max-width: 100% !important;
}

.mm-gdf-modal-form-wrap .wpforms-field-name .wpforms-field-row::before,
.mm-gdf-modal-form-wrap .wpforms-field-name .wpforms-field-row::after {
    display: none !important;
}

.mm-gdf-modal-form-wrap .wpforms-field-name .wpforms-field-row-block {
    flex: 1 1 0;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

.mm-gdf-modal-form-wrap input[type="text"],
.mm-gdf-modal-form-wrap input[type="email"],
.mm-gdf-modal-form-wrap input[type="tel"] {
    width: 100% !important;
    max-width: 100% !important;
    height: 38px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #fff !important;
    color: var(--mm-gdf-ink) !important;
    font-family: inherit !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.mm-gdf-modal-form-wrap input::placeholder {
    color: #444;
    opacity: 1;
}

.mm-gdf-modal-form-wrap input:focus {
    outline: 2px solid var(--mm-gdf-tan) !important;
    outline-offset: 0 !important;
}

/* Errors need to read on navy */
.mm-gdf-modal-form-wrap label.wpforms-error,
.mm-gdf-modal-form-wrap em.wpforms-error,
.mm-gdf-modal-form-wrap .wpforms-error-container,
.mm-gdf-modal-form-wrap .wpforms-error-alert {
    margin-top: 6px !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    color: #FFC2C2 !important;
    font-size: 13px !important;
}

.mm-gdf-modal-form-wrap .wpforms-field input.wpforms-error {
    outline: 2px solid #FFC2C2 !important;
}

.mm-gdf-modal-form-wrap .wpforms-recaptcha-container {
    padding: 0 !important;
}

.mm-gdf-modal-form-wrap .wpforms-submit-container {
    margin: 32px 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.mm-gdf-modal-form-wrap .wpforms-submit {
    min-width: 153px;
    height: 48px !important;
    padding: 0 32px !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: var(--mm-gdf-plum) !important;
    color: #fff !important;
    font-family: inherit !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    text-transform: none !important;
    box-shadow: none !important;
    cursor: pointer;
}

.mm-gdf-modal-form-wrap .wpforms-submit:hover,
.mm-gdf-modal-form-wrap .wpforms-submit:focus-visible {
    background: var(--mm-gdf-plum-hover) !important;
}

.mm-gdf-modal-form-wrap .wpforms-submit:focus-visible {
    outline: 2px solid #fff !important;
    outline-offset: 2px !important;
}

/* AJAX confirmation message, if a form is set to show a message instead of redirecting */
.mm-gdf-modal-form-wrap .wpforms-confirmation-container-full {
    margin: 0 !important;
    background: #fff !important;
    border: 0 !important;
    color: var(--mm-gdf-ink) !important;
}

@media (max-width: 640px) {
    .mm-gdf-modal-overlay {
        padding: 12px;
    }

    .mm-gdf-modal-box {
        padding: 44px 24px 32px;
        max-height: calc(100vh - 24px);
    }

    .mm-gdf-modal-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 20px;
    }

    .mm-gdf-modal-cover {
        flex-basis: auto;
        width: 150px;
    }

    .mm-gdf-modal-box .mm-gdf-modal-headline {
        font-size: 23px;
        margin-bottom: 12px;
    }

    .mm-gdf-modal-box .mm-gdf-modal-subcopy {
        font-size: 16px;
    }

    .mm-gdf-modal-form-wrap {
        margin-top: 32px;
    }

    .mm-gdf-modal-form-wrap .wpforms-field-name .wpforms-field-row {
        flex-direction: column;
        gap: 14px;
    }

    .mm-gdf-modal-form-wrap .wpforms-submit {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mm-gdf-grid .mm-gdf-card-btn {
        transition: none;
    }
}
