/**
 * AC Valve Alliance - Gravity Forms Global Styles
 * 
 * Consolidated Gravity Forms styling for consistent form appearance
 * across all pages and contexts.
 */

/* ============================================
   Reset & Base Wrapper Styles
   ============================================ */
.gform_wrapper {
    margin: 0;
}

.gform_wrapper.gravity-theme,
.gform_wrapper.gform-theme--framework {
    --gf-color-primary: #ee7f2d;
    --gf-color-secondary: #0d4f5c;
    --gf-ctrl-border-color: transparent;
    --gf-ctrl-border-radius: 0px;
    --gf-ctrl-bg-color: #f3f3f3;
    --gf-ctrl-bg-color-focus: #f3f3f3;
    --gf-label-color-primary: #0d4f5c;
}

/* ============================================
   Form Fields - Light Background Context
   (Contact page, general pages)
   ============================================ */
.gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.gform_wrapper select,
.gform_wrapper textarea,
.gform_wrapper.gform-theme--framework input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.gform_wrapper.gform-theme--framework select,
.gform_wrapper.gform-theme--framework textarea {
    width: 100%;
    border: none !important;
    border-radius: 0 !important;
    background: #f3f3f3 !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    color: #0f2b3b !important;
    box-sizing: border-box;
    box-shadow: none !important;
}

.gform_wrapper input:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus,
.gform_wrapper.gform-theme--framework input:focus,
.gform_wrapper.gform-theme--framework select:focus,
.gform_wrapper.gform-theme--framework textarea:focus {
    outline: none !important;
    border-color: transparent !important;
    box-shadow: 0 0 0 2px rgba(28, 143, 167, 0.15) !important;
}

/* ============================================
   Labels - Teal Color
   ============================================ */
.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label,
.gform_wrapper label.gfield_label,
.gform_wrapper.gform-theme--framework .gfield_label,
.gform_wrapper.gform-theme--framework .gform-field-label,
.gform_wrapper.gform-theme--framework .gform-field-label:where(:not([class*=gform-field-label--type-])),
.gform_wrapper .gfield .gfield_label,
.gform_wrapper .ginput_complex label,
.gform_wrapper .ginput_complex span label {
    color: #0d4f5c !important;
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

/* Sub-labels (First, Last under name fields) */
.gform_wrapper .ginput_container_name label,
.gform_wrapper .name_first label,
.gform_wrapper .name_last label {
    color: #0d4f5c !important;
    font-size: 0.85rem;
    font-weight: 400;
}

/* Required legend */
.gform_wrapper .gform_required_legend {
    display: none;
}

/* ============================================
   Form Fields - Dark Background Context
   (Sidebars on product, service, manufacturer, training pages)
   ============================================ */
.acv-product-form-wrapper .gform_wrapper .gfield_label,
.acv-product-form-wrapper .gform_wrapper .gform-field-label,
.acv-service-form-wrapper .gform_wrapper .gfield_label,
.acv-service-form-wrapper .gform_wrapper .gform-field-label,
.acv-product-body-sidebar .gform_wrapper .gfield_label,
.acv-product-body-sidebar .gform_wrapper .gform-field-label,
.acv-service-body-sidebar .gform_wrapper .gfield_label,
.acv-service-body-sidebar .gform_wrapper .gform-field-label,
.acv-manufacturer-sidebar .gform_wrapper .gfield_label,
.acv-manufacturer-sidebar .gform_wrapper .gform-field-label,
.acv-training-sidebar .gform_wrapper .gfield_label,
.acv-training-sidebar .gform_wrapper .gform-field-label {
    color: #ffffff !important;
}

/* ============================================
   Submit Buttons - Orange Rounded Style
   ============================================ */
.gform_wrapper input[type="submit"],
.gform_wrapper .gform_button,
.gform_wrapper button[type="submit"],
.gform_wrapper.gform-theme--framework input[type="submit"],
.gform_wrapper.gform-theme--framework .gform_button,
.gform_wrapper.gform-theme--framework button[type="submit"],
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_footer button[type="submit"] {
    background-color: #ee7f2d !important;
    background: #ee7f2d !important;
    color: #ffffff !important;
    font-weight: 400 !important;
    padding: 15px 40px !important;
    font-size: 16px !important;
    border: none !important;
    border-radius: 25px !important;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    box-shadow: none !important;
}

.gform_wrapper input[type="submit"]:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper button[type="submit"]:hover,
.gform_wrapper.gform-theme--framework input[type="submit"]:hover,
.gform_wrapper.gform-theme--framework .gform_button:hover,
.gform_wrapper.gform-theme--framework button[type="submit"]:hover {
    opacity: 0.9;
    background-color: #dd7826 !important;
}

/* Contact page submit button */
.acv-contact-form-wrapper .gform_wrapper input[type="submit"],
.acv-contact-form-wrapper .gform_wrapper .gform_button {
    min-width: 160px;
    border-radius: 999px !important;
    box-shadow: none !important;
}

/* ============================================
   Field Spacing
   ============================================ */
.gform_wrapper .gfield,
.gform_wrapper.gform-theme--framework .gfield {
    margin-bottom: 8px !important;
}

.gform_wrapper .gform_fields,
.gform_wrapper.gform-theme--framework .gform_fields {
    grid-row-gap: 10px !important;
    row-gap: 10px !important;
}

/* Reduce space between input and label */
.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
    margin-bottom: 4px !important;
}

/* ============================================
   Blog Post Sidebar Forms
   ============================================ */
.acv-sp-contact .gform_wrapper {
    margin: 0;
}

.acv-sp-contact .gfield {
    margin-bottom: 15px;
}

.acv-sp-contact .gform_wrapper input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.acv-sp-contact .gform_wrapper select,
.acv-sp-contact .gform_wrapper textarea {
    background: #ffffff !important;
    border-radius: 0px !important;
}

/* ============================================
   Modal Forms (Vacancies, etc.)
   ============================================ */
.acv-modal-body .gform_wrapper {
    margin: 0;
}

/* ============================================
   Validation & Error States
   ============================================ */
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea {
    border: 1px solid #c02b0a !important;
}

.gform_wrapper .validation_message,
.gform_wrapper .gfield_validation_message {
    color: #c02b0a;
    font-size: 0.875rem;
    margin-top: 5px;
}

.gform_wrapper .gform_validation_errors {
    background-color: #fef2f2;
    border: 1px solid #c02b0a;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

/* ============================================
   Confirmation Messages
   ============================================ */
.gform_wrapper .gform_confirmation_message {
    background-color: #f0fdf4;
    border: 1px solid #22c55e;
    border-radius: 6px;
    padding: 20px;
    color: #166534;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .gform_wrapper input[type="submit"],
    .gform_wrapper .gform_button,
    .gform_wrapper button[type="submit"] {
        width: 100%;
        padding: 14px 30px !important;
    }
    
    .acv-contact-form-wrapper .gform_wrapper input[type="submit"],
    .acv-contact-form-wrapper .gform_wrapper .gform_button {
        min-width: auto;
    }
}
