/*
 * Gravity Forms styles for Avada Child theme
 */

/* Override Orbital Theme CSS Variables + wrapper layout (no max-width / no bottom margin) */
.gform_wrapper,
.gform_wrapper.gform-theme {
    max-width: none !important;
    width: 100% !important;
    margin-bottom: 0 !important;
    --gf-ctrl-shadow: none !important;
    --gf-ctrl-shadow-focus: none !important;
    --gf-ctrl-out-shadow: none !important;
    --gf-radius: 8px !important;
    --gf-color-primary: #799A0B !important;
    --gf-color-primary-darker: #6A813D !important;
    --gf-color-primary-contrast: #ffffff !important;
    --gf-color-secondary-contrast: #17312E !important;
    --gf-ctrl-border-color: transparent !important;
    --gf-ctrl-label-color-primary: #17312E !important;
    --gf-ctrl-label-color-secondary: #17312E !important;
    --gf-color-in-ctrl-primary: #799A0B !important;
    --gf-color-out-ctrl-dark: #6A813D !important;
}

/* Open Sans from Google Fonts (Gravity Forms) */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap');

/* Main Form Wrapper - Force font family everywhere */
.gform_wrapper,
.gform_wrapper * {
  font-family: 'Open Sans', sans-serif !important;
}

/*
 * Avada / Gravity Forms select chevrons use a PUA glyph (e.g. U+E61F) from the theme
 * icon font. The rule above would override that with Open Sans and show "tofu".
 * Override Avada `#wrapper .select-arrow { background-color: var(--form_bg_color); }`
 * so the chevron strip matches form field fill (#EDEAE2).
 */
#wrapper .gform_wrapper .gravity-select-parent .select-arrow,
.gform_wrapper .gravity-select-parent .select-arrow,
#wrapper .gform_wrapper .select-arrow,
.gform_wrapper .select-arrow {
  font-family: 'awb-icons', 'icomoon', sans-serif !important;
  background-color: #EDEAE2 !important;
  color: #17312E !important;
}

/* Keep chevron colour on focus (Avada uses `var(--form_focus_border_color)` on `select:focus + .select-arrow`) */
#wrapper .gform_wrapper .gravity-select-parent select:focus + .select-arrow,
.gform_wrapper .gravity-select-parent select:focus + .select-arrow {
  color: #17312E !important;
}

/* Heading styling */
.gform_wrapper .gform_heading h3,
.gform_wrapper .gform_heading .gform_title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #17312E !important;
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
}

/* Field spacing - Reduced gaps */
.gform_wrapper .gform_body .gform_fields {
  row-gap: 12px !important;
  grid-row-gap: 12px !important;
  display: grid !important;
}

.gform_wrapper .gform_fields .gfield {
    margin-bottom: 0 !important;
    padding: 0 !important;
    padding-bottom: 6px !important;
}

/* Label styling - Larger and more readable */
.gform_wrapper .gfield_label,
.gform_wrapper .gform-field-label {
    font-size: 14px !important;
    font-weight: 400 !important;
    color: #17312E !important;
    margin-bottom: 6px !important;
    display: block !important;
    text-transform: capitalize !important;
}

/* Beats GF `.gform_wrapper .top_label .gfield_label { margin-bottom: 0 }` (same !important, higher specificity) */
body .gform_wrapper .top_label .gfield_label,
body .gform_wrapper .top_label .gform-field-label {
    margin-bottom: 6px !important;
}

/* Hide the "(Required)" text visually but keep for screen readers */
.gform_wrapper .gfield_required_text {
    position: absolute !important;
    left: -9999px !important;
}

/* Show asterisk only */
.gform_wrapper .gfield_required {
    color: #799A0B !important;
    font-weight: 600 !important;
}

/* Input field styling — no elevation; single-line controls fixed 40px tall */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="search"],
.gform_wrapper input[type="password"],
.gform_wrapper input[type="date"],
.gform_wrapper input[type="time"],
.gform_wrapper input[type="datetime-local"],
.gform_wrapper input[type="month"],
.gform_wrapper input[type="week"],
.gform_wrapper textarea,
.gform_wrapper select {
    --gf-ctrl-border-color: transparent !important;
    --gf-ctrl-shadow: none !important;
    --gf-ctrl-shadow-focus: none !important;
    width: 100% !important;
    padding: 0 12px !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    color: #17312E !important;
    background-color: #EDEAE2 !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s ease, background-color 0.3s ease !important;
    box-sizing: border-box !important;
    font-family: 'Open Sans', sans-serif !important;
    line-height: 1.35 !important;
}

.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="search"],
.gform_wrapper input[type="password"],
.gform_wrapper input[type="date"],
.gform_wrapper input[type="time"],
.gform_wrapper input[type="datetime-local"],
.gform_wrapper input[type="month"],
.gform_wrapper input[type="week"],
.gform_wrapper select {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    line-height: 44px !important;
}

.gform_wrapper input[type="text"]:hover,
.gform_wrapper input[type="email"]:hover,
.gform_wrapper input[type="number"]:hover,
.gform_wrapper input[type="tel"]:hover,
.gform_wrapper input[type="url"]:hover,
.gform_wrapper input[type="search"]:hover,
.gform_wrapper input[type="password"]:hover,
.gform_wrapper input[type="date"]:hover,
.gform_wrapper input[type="time"]:hover,
.gform_wrapper input[type="datetime-local"]:hover,
.gform_wrapper input[type="month"]:hover,
.gform_wrapper input[type="week"]:hover,
.gform_wrapper textarea:hover,
.gform_wrapper select:hover,
.gform_wrapper input[type="text"]:active,
.gform_wrapper input[type="email"]:active,
.gform_wrapper input[type="number"]:active,
.gform_wrapper input[type="tel"]:active,
.gform_wrapper input[type="url"]:active,
.gform_wrapper input[type="search"]:active,
.gform_wrapper input[type="password"]:active,
.gform_wrapper input[type="date"]:active,
.gform_wrapper input[type="time"]:active,
.gform_wrapper input[type="datetime-local"]:active,
.gform_wrapper input[type="month"]:active,
.gform_wrapper input[type="week"]:active,
.gform_wrapper textarea:active,
.gform_wrapper select:active {
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.gform_wrapper select.large.gfield_select {
    font-size: 16px !important;
}

/* Orbital / theme often styles the container, not only the native control */
.gform_wrapper .gfield .ginput_container:not(.ginput_container_fileupload) {
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    outline: none !important;
}

.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="number"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper input[type="url"]:focus,
.gform_wrapper input[type="search"]:focus,
.gform_wrapper input[type="password"]:focus,
.gform_wrapper input[type="date"]:focus,
.gform_wrapper input[type="time"]:focus,
.gform_wrapper input[type="datetime-local"]:focus,
.gform_wrapper input[type="month"]:focus,
.gform_wrapper input[type="week"]:focus,
.gform_wrapper textarea:focus,
.gform_wrapper select:focus,
.gform_wrapper input[type="text"]:focus-visible,
.gform_wrapper input[type="email"]:focus-visible,
.gform_wrapper input[type="number"]:focus-visible,
.gform_wrapper input[type="tel"]:focus-visible,
.gform_wrapper input[type="url"]:focus-visible,
.gform_wrapper input[type="search"]:focus-visible,
.gform_wrapper input[type="password"]:focus-visible,
.gform_wrapper input[type="date"]:focus-visible,
.gform_wrapper input[type="time"]:focus-visible,
.gform_wrapper input[type="datetime-local"]:focus-visible,
.gform_wrapper input[type="month"]:focus-visible,
.gform_wrapper input[type="week"]:focus-visible,
.gform_wrapper textarea:focus-visible,
.gform_wrapper select:focus-visible {
    outline: none !important;
    outline-color: transparent !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
    filter: none !important;
}

/* Placeholder styling */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
    color: #717171 !important;
    opacity: 1 !important;
    font-size: 16px !important;
}

/* Select dropdown — value text matches inputs */
.gform_wrapper select {
    color: #17312E !important;
    font-size: 16px !important;
}

.gform_wrapper select option {
    color: #17312E !important;
    font-size: 16px !important;
}

/* Default/placeholder option styling */
.gform_wrapper select option:first-child {
    color: #717171 !important;
}

/* Name field - make it full width */
.gform_wrapper .ginput_container_name {
    display: block !important;
}

.gform_wrapper .ginput_container_name .gform-grid-row {
    display: block !important;
}

.gform_wrapper .name_first {
    width: 100% !important;
    display: block !important;
}

.gform_wrapper .name_first input {
    width: 100% !important;
}

/* Add a country code prefix visual */
.gform_wrapper .ginput_container_number {
    position: relative;
}

/* Textarea — not fixed 40px; multi-line padding */
.gform_wrapper textarea {
    height: auto !important;
    min-height: 100px !important;
    max-height: none !important;
    padding: 8px 12px !important;
    line-height: 1.35 !important;
    resize: vertical !important;
}

/* Character counter */
.gform_wrapper .charleft,
.gform_wrapper .ginput_counter {
    font-size: 12px !important;
    color: #999 !important;
    margin-top: 4px !important;
    text-align: right !important;
    display: block !important;
}

/* Field description */
.gform_wrapper .gfield_description {
    font-size: 12px !important;
    color: #666 !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
}

/* Submit button styling */
body .gform_wrapper .gform_button,
body .gform_wrapper .gform_footer input[type="submit"] {
  padding-top: 14px !important;
  padding-right: 24px !important;
  padding-bottom: 14px !important;
  padding-left: 24px !important;
  line-height: 1 !important;
  font-size: 14px !important;
  background: #799A0B !important;
  color: #fff !important;
  border: 1px solid #799A0B !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
  position: relative !important;
  text-decoration: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  font-family: 'Open Sans', sans-serif !important;
  font-weight: 600 !important;
  font-style: normal !important;
  letter-spacing: 0.5px !important;
  border-radius: 8px !important;
  text-transform: uppercase !important;
  transition: all 0.2s ease-in-out !important;
  margin: 0 !important;
  width: 100% !important;
  margin-top: 12px !important;
}

body .gform_wrapper .gform_button:hover,
body .gform_wrapper .gform_footer input[type="submit"]:hover {
  background: #6A813D !important;
  border-color: #6A813D !important;
  color: #fff !important;
}

body .gform_wrapper .gform_button:active,
body .gform_wrapper .gform_footer input[type="submit"]:active {
  transform: translateY(1px) !important;
}

/* Validation message styling */
.gform_wrapper .gfield_validation_message,
.gform_wrapper .validation_message {
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #e74c3c !important;
    padding: 8px 12px !important;
    background: #fef2f2 !important;
    border-left: 3px solid #e74c3c !important;
    border-radius: 4px !important;
}

/* Error state for inputs */
.gform_wrapper .gfield_error input[type="text"],
.gform_wrapper .gfield_error input[type="email"],
.gform_wrapper .gfield_error input[type="number"],
.gform_wrapper .gfield_error input[type="tel"],
.gform_wrapper .gfield_error input[type="url"],
.gform_wrapper .gfield_error input[type="search"],
.gform_wrapper .gfield_error input[type="password"],
.gform_wrapper .gfield_error input[type="date"],
.gform_wrapper .gfield_error input[type="time"],
.gform_wrapper .gfield_error input[type="datetime-local"],
.gform_wrapper .gfield_error input[type="month"],
.gform_wrapper .gfield_error input[type="week"],
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select {
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    background-color: #fef2f2 !important;
    color: #17312E !important;
}

/* Remove complex field grid for name */
.gform_wrapper .gf_name_has_1 {
    display: block !important;
}

/* Footer spacing */
.gform_wrapper .gform_footer {
    margin-top: 12px !important;
    padding-top: 0 !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .gform_wrapper {
        max-width: none !important;
        width: 100% !important;
        margin-bottom: 0 !important;
        padding: 0 15px !important;
    }

    .gform_wrapper .gform_heading h3,
    .gform_wrapper .gform_heading .gform_title {
        font-size: 18px !important;
    }
}

/* Gravity Forms theme foundation */
.gform-theme--foundation .gfield textarea.small {
    min-block-size: 100px !important;
}
