/* ============================================
   GRAVITY FORMS — UPGRADE COMMUNICATION THEME
   Full override — compatible with GF 2.5+ / 2.8+
   Targets both .gravity-theme and generic .gform_wrapper
   ============================================ */

/* --- RESET WRAPPER --- */
.gform_wrapper,
.gform_wrapper.gravity-theme,
.gform_wrapper.gform-theme--no-framework {
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    border: none !important;
    background: transparent !important;
}

.gform_wrapper .gform_body,
.gform_wrapper.gravity-theme .gform_body {
    padding: 0 !important;
}

/* --- FIELDS GRID --- */
.gform_wrapper .gform_fields,
.gform_wrapper.gravity-theme .gform_fields {
    display: flex !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
    gap: 1.5rem !important;
    grid-column-gap: 1.5rem !important;
    grid-row-gap: 1.5rem !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

/* Field widths */
.gform_wrapper .gfield,
.gform_wrapper.gravity-theme .gfield {
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gform_wrapper .gfield--width-half,
.gform_wrapper.gravity-theme .gfield--width-half {
    width: calc(50% - 0.75rem) !important;
}

.gform_wrapper .gfield--width-third,
.gform_wrapper.gravity-theme .gfield--width-third {
    width: calc(33.333% - 1rem) !important;
}

/* --- LABELS --- */
.gform_wrapper .gfield_label,
.gform_wrapper .gfield_label_before_complex,
.gform_wrapper.gravity-theme .gfield_label,
.gform_wrapper.gravity-theme .gfield_label_before_complex,
.gform_wrapper .gform-field-label {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    color: #B0B0B0 !important;
    margin-bottom: 0.6rem !important;
    padding: 0 !important;
    line-height: 1.4 !important;
}

/* Sub-labels */
.gform_wrapper .ginput_complex label,
.gform_wrapper .name_first label,
.gform_wrapper .name_last label,
.gform_wrapper .gform-field-label--type-sub {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.65rem !important;
    font-weight: 400 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: #B0B0B0 !important;
    margin-top: 0.3rem !important;
}

/* Required asterisk */
.gform_wrapper .gfield_required,
.gform_wrapper .gfield_required_asterisk {
    color: #bb011b !important;
}

/* --- INPUT FIELDS --- */
.gform_wrapper input[type="text"],
.gform_wrapper input[type="email"],
.gform_wrapper input[type="tel"],
.gform_wrapper input[type="url"],
.gform_wrapper input[type="number"],
.gform_wrapper input[type="password"],
.gform_wrapper input[type="date"],
.gform_wrapper select,
.gform_wrapper textarea,
.gform_wrapper .ginput_container input,
.gform_wrapper .ginput_container select,
.gform_wrapper .ginput_container textarea {
    width: 100% !important;
    padding: 0.9rem 0 !important;
    border: none !important;
    border-bottom: 1px solid #F2F2F2 !important;
    border-radius: 0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.95rem !important;
    font-weight: 300 !important;
    color: #1A1A1A !important;
    background: transparent !important;
    transition: border-color 0.3s ease !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    line-height: 1.5 !important;
}

/* Focus state */
.gform_wrapper input[type="text"]:focus,
.gform_wrapper input[type="email"]:focus,
.gform_wrapper input[type="tel"]:focus,
.gform_wrapper input[type="url"]:focus,
.gform_wrapper input[type="number"]:focus,
.gform_wrapper input[type="password"]:focus,
.gform_wrapper input[type="date"]:focus,
.gform_wrapper select:focus,
.gform_wrapper textarea:focus {
    border-bottom-color: #1A1A1A !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Textarea */
.gform_wrapper textarea {
    resize: vertical !important;
    min-height: 100px !important;
}

/* Placeholder */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
    color: #B0B0B0 !important;
    font-weight: 300 !important;
    opacity: 1 !important;
}

/* Select dropdown arrow */
.gform_wrapper select {
    cursor: pointer !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%23B0B0B0' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0 center !important;
    padding-right: 1.5rem !important;
}

/* --- CHECKBOX & RADIO --- */
.gform_wrapper .gchoice,
.gform_wrapper .gfield_checkbox .gchoice,
.gform_wrapper .gfield_radio .gchoice {
    margin-bottom: 0.5rem !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.6rem !important;
}

.gform_wrapper .gchoice label,
.gform_wrapper .gfield_consent_description {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 300 !important;
    color: #3A3A3A !important;
    cursor: pointer !important;
    line-height: 1.5 !important;
}

.gform_wrapper input[type="checkbox"],
.gform_wrapper input[type="radio"] {
    accent-color: #bb011b !important;
    width: 16px !important;
    height: 16px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
}

/* --- CONSENT / GDPR FIELD --- */
.gform_wrapper .gfield_consent_label,
.gform_wrapper .ginput_container_consent label {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 300 !important;
    color: #3A3A3A !important;
    line-height: 1.5 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.gform_wrapper .gfield_consent_label a,
.gform_wrapper .ginput_container_consent a {
    text-decoration: underline !important;
    transition: color 0.3s !important;
}

.gform_wrapper .gfield_consent_label a:hover,
.gform_wrapper .ginput_container_consent a:hover {
    color: #bb011b !important;
}

/* --- COMPLEX FIELDS (name, address) --- */
.gform_wrapper .ginput_complex {
    display: flex !important;
    gap: 1.5rem !important;
    flex-wrap: wrap !important;
}

.gform_wrapper .ginput_complex .ginput_full {
    width: 100% !important;
}

.gform_wrapper .ginput_complex .ginput_left,
.gform_wrapper .ginput_complex .ginput_right,
.gform_wrapper .ginput_complex > span {
    flex: 1 !important;
    min-width: 0 !important;
}

/* --- SUBMIT BUTTON --- */
.gform_wrapper .gform_footer,
.gform_wrapper .gform_page_footer {
    margin: 1.5rem 0 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
}

.gform_wrapper input[type="submit"],
.gform_wrapper .gform_button,
.gform_wrapper button[type="submit"],
.gform_wrapper .gform-button,
.gform_wrapper .gform_footer .gform_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.6rem !important;
    padding: 1rem 2.5rem !important;
    background: #bb011b !important;
    color: #FFFFFF !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    letter-spacing: 0.12em !important;
    text-transform: uppercase !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: 1.4 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

.gform_wrapper input[type="submit"]:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper button[type="submit"]:hover,
.gform_wrapper .gform-button:hover {
    background: #9a0016 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 40px rgba(187, 1, 27, 0.2) !important;
}

/* --- VALIDATION ERRORS --- */
.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error textarea,
.gform_wrapper .gfield_error select {
    border-bottom-color: #bb011b !important;
}

.gform_wrapper .gfield_error .gfield_label,
.gform_wrapper .gfield_error .gform-field-label {
    color: #bb011b !important;
}

.gform_wrapper .validation_message,
.gform_wrapper .gfield_description.validation_message,
.gform_wrapper .gfield_validation_message {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: #bb011b !important;
    padding: 0.4rem 0 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
}

.gform_wrapper .gform_validation_errors,
.gform_wrapper .validation_error {
    background: rgba(187, 1, 27, 0.05) !important;
    border: 1px solid rgba(187, 1, 27, 0.2) !important;
    border-radius: 0 !important;
    padding: 1rem 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.gform_wrapper .gform_validation_errors h2,
.gform_wrapper .gform_validation_errors .gform_submission_error {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    color: #bb011b !important;
}

/* Hide validation error icon from GF 2.8+ */
.gform_wrapper .gform_validation_errors > svg,
.gform_wrapper .gfield_validation_message > svg,
.gform_wrapper .gform-icon {
    display: none !important;
}

/* --- CONFIRMATION MESSAGE --- */
.gform_confirmation_message,
.gform_wrapper .gform_confirmation_message {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 300 !important;
    color: #1A1A1A !important;
    line-height: 1.7 !important;
    padding: 2rem !important;
    background: rgba(187, 1, 27, 0.04) !important;
    border-left: 3px solid #bb011b !important;
    border-radius: 0 !important;
}

/* --- DESCRIPTION FIELDS --- */
.gform_wrapper .gfield_description:not(.validation_message) {
    font-family: 'Inter', -apple-system, sans-serif !important;
    font-size: 0.78rem !important;
    font-weight: 300 !important;
    color: #B0B0B0 !important;
    margin-top: 0.3rem !important;
}

/* --- SECTION BREAKS --- */
.gform_wrapper .gsection {
    border-bottom: 1px solid #F2F2F2 !important;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0 !important;
}

.gform_wrapper .gsection .gsection_title {
    font-family: 'Cormorant Garamond', Georgia, serif !important;
    font-size: 1.4rem !important;
    font-weight: 400 !important;
    color: #1A1A1A !important;
}

/* --- FILE UPLOAD --- */
.gform_wrapper .gform_drop_area {
    border: 1px dashed #E0E0E0 !important;
    border-radius: 0 !important;
    padding: 2rem !important;
    text-align: center !important;
    transition: border-color 0.3s !important;
    background: transparent !important;
}

.gform_wrapper .gform_drop_area:hover {
    border-color: #bb011b !important;
}

/* --- PROGRESS BAR (multi-step) --- */
.gform_wrapper .gf_progressbar {
    background: #F2F2F2 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
    margin-bottom: 2rem !important;
}

.gform_wrapper .gf_progressbar_percentage {
    background: #bb011b !important;
    border-radius: 0 !important;
    height: 3px !important;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.gform_wrapper .gf_progressbar_percentage span {
    display: none !important;
}

/* --- SPINNER --- */
.gform_wrapper .gform_ajax_spinner {
    margin-left: 1rem !important;
}

/* --- HIDDEN ELEMENTS --- */
.gform_wrapper .gform_footer .gform_image_chooser,
.gform_wrapper .gform_page_footer .gform_image_chooser {
    display: none !important;
}

/* Hide "powered by" text in GF */
.gform_wrapper .gform_footer::after {
    display: none !important;
}

/* --- GF 2.8+ ORBITAL/THEME RESET --- */
.gform_wrapper.gform-theme--no-framework .gfield,
.gform_wrapper.gform-theme--no-framework .ginput_container {
    margin: 0 !important;
    padding: 0 !important;
}

.gform_wrapper.gform-theme--no-framework .gform_fields {
    row-gap: 1.5rem !important;
}

/* Reset any GF 2.8+ custom properties/variables */
.gform_wrapper {
    --gf-color-primary: #bb011b !important;
    --gf-color-primary-rgb: 187, 1, 27 !important;
    --gf-color-danger: #bb011b !important;
    --gf-ctrl-border-color: #F2F2F2 !important;
    --gf-ctrl-border-color-focus: #1A1A1A !important;
    --gf-ctrl-border-radius: 0 !important;
    --gf-ctrl-bg-color: transparent !important;
    --gf-ctrl-font-family: 'Inter', -apple-system, sans-serif !important;
    --gf-ctrl-font-size: 0.95rem !important;
    --gf-ctrl-label-font-family: 'Inter', -apple-system, sans-serif !important;
    --gf-ctrl-label-font-size: 0.7rem !important;
    --gf-ctrl-label-color: #B0B0B0 !important;
    --gf-ctrl-desc-font-size: 0.78rem !important;
    --gf-ctrl-desc-color: #B0B0B0 !important;
    --gf-btn-bg-color: #bb011b !important;
    --gf-btn-bg-color-hover: #9a0016 !important;
    --gf-btn-border-color: #bb011b !important;
    --gf-btn-border-radius: 0 !important;
    --gf-btn-color: #FFFFFF !important;
    --gf-btn-font-family: 'Inter', -apple-system, sans-serif !important;
    --gf-btn-font-size: 0.78rem !important;
    --gf-btn-padding-block: 1rem !important;
    --gf-btn-padding-inline: 2.5rem !important;
}

/* --- MOBILE --- */
@media (max-width: 768px) {
    .gform_wrapper .gfield--width-half,
    .gform_wrapper .gfield--width-third {
        width: 100% !important;
    }

    .gform_wrapper .ginput_complex {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .gform_wrapper input[type="submit"],
    .gform_wrapper .gform_button,
    .gform_wrapper button[type="submit"],
    .gform_wrapper .gform-button {
        width: 100% !important;
    }

    .gform_wrapper .gform_fields {
        gap: 1.2rem !important;
    }
}
