.gform_title {
    font-family: "Playfair Display", serif !important;
    font-size: 56px;
    font-weight: bold;
    font-style: normal;
}

/* === Overlay === */
.nrgft-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glassy dark overlay */
.nrgft-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
}

/* === Modal Card === */
.nrgft-content {
    position: relative;
    z-index: 2;

    width: 92%;
    max-width: 560px;
    max-height: 85vh;
    overflow-y: auto;

    background: #ffffff;
    border-radius: 16px;
    padding: 32px;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.12),
        0 2px 10px rgba(0, 0, 0, 0.06);

    animation: nrgftFadeScale 0.25s ease;
}

/* === Header === */
.nrgft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.nrgft-title {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

/* Close button
 * Default: #1c3628 on #ffffff = 10.5:1 (WCAG AAA).
 * Hover:   #7a3e28 on #ffffff = 5.84:1 (WCAG AA).
 */
.nrgft-close {
    border: none;
    float: right;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    color: #1c3628;
    transition: color 0.2s ease, transform 0.2s ease;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.nrgft-close:hover {
    color: #7a3e28;
    transform: scale(1.1);
}

.nrgft-close:focus {
    outline: none;
}

.nrgft-close:focus-visible {
    outline: 3px solid #1c3628;
    outline-offset: 2px;
}

/* === Body === */
.nrgft-body {
    margin-top: 10px;
}

/* === Gravity Forms Styling ===
 *
 * WHY THE LONG SELECTOR:
 * gravity_form_enqueue_scripts() loads GF's own stylesheet, which uses
 * selectors like .gform_wrapper .gfield input.large (3-class specificity).
 * Our old ".nrgft-content input" (1-class) lost that battle once GF's CSS
 * was on the page. Prefixing with ".nrgft-modal .nrgft-content .gform_wrapper"
 * gives us 3-class specificity minimum, ensuring our styles always win
 * without resorting to !important.
 */

.nrgft-modal .nrgft-content .gform_wrapper {
    margin: 0;
}

/* Inputs */
.nrgft-modal .nrgft-content .gform_wrapper input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]):not([type="hidden"]),
.nrgft-modal .nrgft-content .gform_wrapper textarea,
.nrgft-modal .nrgft-content .gform_wrapper select {
    width: 90%;
    padding: 12px 14px;
    border: 1px solid #1c3628;
    border-radius: 40px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.nrgft-modal .nrgft-content .gform_wrapper input:not([type="submit"]):not([type="radio"]):not([type="checkbox"]):not([type="hidden"]):focus,
.nrgft-modal .nrgft-content .gform_wrapper textarea:focus,
.nrgft-modal .nrgft-content .gform_wrapper select:focus {
    border-color: #1c3628;
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 54, 40, 0.25);
}

/* Labels */
.nrgft-modal .nrgft-content .gform_wrapper .gfield_label {
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
    color: #334155;
}

/* Radio/checkbox inputs must keep their natural size */
.nrgft-modal .nrgft-content .gform_wrapper .gfield_radio input[type="radio"],
.nrgft-modal .nrgft-content .gform_wrapper .gfield_checkbox input[type="checkbox"] {
    width: unset;
    border-radius: 0;
    padding: 0;
}

/* Submit button */
.nrgft-modal .nrgft-content .gform_wrapper .gform_button {
    width: 90%;
    padding: 25px;
    margin: 10px;
    background: #1c3628;
    color: #f7f4ef;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nrgft-modal .nrgft-content .gform_wrapper .gform_button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(28, 54, 40, 0.3);
}

.nrgft-modal .nrgft-content .gform_wrapper .gform_button:focus-visible {
    outline: 3px solid #1c3628;
    outline-offset: 2px;
}

/* === Animation === */
@keyframes nrgftFadeScale {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Reduced-motion override — WCAG 2.3.3 (AA in WCAG 2.2) */
@media (prefers-reduced-motion: reduce) {
    .nrgft-content {
        animation: none;
    }

    .nrgft-close,
    .nrgft-modal .nrgft-content .gform_wrapper input,
    .nrgft-modal .nrgft-content .gform_wrapper textarea,
    .nrgft-modal .nrgft-content .gform_wrapper select,
    .nrgft-modal .nrgft-content .gform_wrapper .gform_button {
        transition: none;
    }
}

/* === Mobile === */
@media (max-width: 600px) {
    .nrgft-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        padding: 24px;
    }
}
