/**
 * Gravity Forms — Theme Overrides
 * Matches NJ Criminal Attorneys design system:
 *   - Dark context: #0a0a0a bg, white text, rgba borders
 *   - Light/sidebar context: white bg, underline inputs, dark text
 *   - Submit buttons: #C26D28, no border-radius, uppercase Montserrat
 */

/* ============================================================
   BASE — Reset Gravity Forms chrome
   ============================================================ */
.gform_wrapper {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}

.gform_wrapper .gform_body {
    margin: 0;
    padding: 0;
}

.gform_wrapper .gform_fields {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.gform_wrapper .gfield {
    padding: 0 !important;
    margin: 0 !important;
}

.gform_wrapper .gfield_label {
    display: none !important;
}

.gform_wrapper .gfield_required {
    display: none !important;
}

.gform_wrapper .ginput_container {
    margin: 0 !important;
}

/* Validation message */
.gform_wrapper .gfield_description.validation_message,
.gform_wrapper .validation_message {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    margin-top: 4px;
    color: #ef4444;
}

/* Confirmation message */
.gform_wrapper .gform_confirmation_message {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    padding: 1.5rem;
    text-align: center;
}

/* Footer (submit button wrapper) */
.gform_wrapper .gform_footer,
.gform_wrapper .gform_page_footer {
    margin: 1rem 0 0 !important;
    padding: 0 !important;
}


/* ============================================================
   DARK CONTEXT — Homepage consultation, inline CTA, bottom CTA
   (sections with dark bg: #0a0a0a or image overlays)
   ============================================================ */

/* Inputs */
.consultation-section .gform_wrapper input[type="text"],
.consultation-section .gform_wrapper input[type="email"],
.consultation-section .gform_wrapper input[type="tel"],
.consultation-section .gform_wrapper textarea,
.single-inline-cta .gform_wrapper input[type="text"],
.single-inline-cta .gform_wrapper input[type="email"],
.single-inline-cta .gform_wrapper input[type="tel"],
.single-inline-cta .gform_wrapper textarea,
.single-bottom-cta .gform_wrapper input[type="text"],
.single-bottom-cta .gform_wrapper input[type="email"],
.single-bottom-cta .gform_wrapper input[type="tel"],
.single-bottom-cta .gform_wrapper textarea {
    background: #1a1a1a;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
    width: 100%;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
}

.consultation-section .gform_wrapper input::placeholder,
.consultation-section .gform_wrapper textarea::placeholder,
.single-inline-cta .gform_wrapper input::placeholder,
.single-inline-cta .gform_wrapper textarea::placeholder,
.single-bottom-cta .gform_wrapper input::placeholder,
.single-bottom-cta .gform_wrapper textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.consultation-section .gform_wrapper input:focus,
.consultation-section .gform_wrapper textarea:focus,
.single-inline-cta .gform_wrapper input:focus,
.single-inline-cta .gform_wrapper textarea:focus,
.single-bottom-cta .gform_wrapper input:focus,
.single-bottom-cta .gform_wrapper textarea:focus {
    border-color: #C26D28;
}

/* Dark context confirmation text */
.consultation-section .gform_confirmation_message,
.single-inline-cta .gform_confirmation_message,
.single-bottom-cta .gform_confirmation_message {
    color: #fff;
}

/* Dark context validation text */
.consultation-section .gform_wrapper .validation_message,
.single-inline-cta .gform_wrapper .validation_message,
.single-bottom-cta .gform_wrapper .validation_message {
    color: #fca5a5;
}

/* Layout — consultation form: 3 inputs in a row + textarea below */
.consultation-section .gform_wrapper .gform_fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.consultation-section .gform_wrapper .gfield--type-textarea {
    grid-column: 1 / -1;
}

/* Inline CTA + Bottom CTA: stack fields in row */
.single-inline-cta .gform_wrapper .gform_fields,
.single-bottom-cta .gform_wrapper .gform_fields {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.single-inline-cta .gform_wrapper .gfield--type-textarea,
.single-bottom-cta .gform_wrapper .gfield--type-textarea {
    grid-column: 1 / -1;
}


/* ============================================================
   LIGHT / SIDEBAR CONTEXT — Sidebar form, contact page form
   ============================================================ */

/* Sidebar form inputs — underline style */
.sidebar-form .gform_wrapper input[type="text"],
.sidebar-form .gform_wrapper input[type="email"],
.sidebar-form .gform_wrapper input[type="tel"],
.sidebar-form .gform_wrapper textarea {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    color: #1a1a1a;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    padding: 0.75rem 0;
    width: 100%;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
}

.sidebar-form .gform_wrapper input::placeholder,
.sidebar-form .gform_wrapper textarea::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.sidebar-form .gform_wrapper input:focus,
.sidebar-form .gform_wrapper textarea:focus {
    border-bottom-color: #C26D28;
}

/* Sidebar: single-column layout */
.sidebar-form .gform_wrapper .gform_fields {
    flex-direction: column;
    gap: 0.5rem;
}

/* Contact page form */
.contact-form-card .gform_wrapper input[type="text"],
.contact-form-card .gform_wrapper input[type="email"],
.contact-form-card .gform_wrapper input[type="tel"],
.contact-form-card .gform_wrapper textarea {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9375rem;
    padding: 0.875rem 1rem;
    width: 100%;
    border-radius: 0;
    outline: none;
    transition: border-color 0.2s ease;
}

.contact-form-card .gform_wrapper input::placeholder,
.contact-form-card .gform_wrapper textarea::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.contact-form-card .gform_wrapper input:focus,
.contact-form-card .gform_wrapper textarea:focus {
    border-color: #C26D28;
}

/* Contact page: single-column layout */
.contact-form-card .gform_wrapper .gform_fields {
    flex-direction: column;
    gap: 1rem;
}


/* ============================================================
   SUBMIT BUTTONS — all contexts
   ============================================================ */
.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"],
.gform_wrapper button[type="submit"] {
    background: #C26D28 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 0 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    padding: 1rem 2rem !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: background 0.2s ease !important;
}

.gform_wrapper .gform_button:hover,
.gform_wrapper input[type="submit"]:hover,
.gform_wrapper button[type="submit"]:hover {
    background: #a85a20 !important;
}


/* ============================================================
   TEXTAREA — consistent height
   ============================================================ */
.gform_wrapper textarea {
    min-height: 120px;
    resize: vertical;
}

.sidebar-form .gform_wrapper textarea {
    min-height: 80px;
}


/* ============================================================
   SPINNER — hide default Gravity Forms spinner
   ============================================================ */
.gform_wrapper .gform_ajax_spinner {
    display: none;
}


/* ============================================================
   RESPONSIVE — stack fields on mobile
   ============================================================ */
@media (max-width: 768px) {
    .consultation-section .gform_wrapper .gform_fields,
    .single-inline-cta .gform_wrapper .gform_fields,
    .single-bottom-cta .gform_wrapper .gform_fields {
        grid-template-columns: 1fr;
    }

    .consultation-section .gform_wrapper .gfield--type-textarea,
    .single-inline-cta .gform_wrapper .gfield--type-textarea,
    .single-bottom-cta .gform_wrapper .gfield--type-textarea {
        grid-column: 1;
    }
}
