/* Gravity Forms — Dark Theme Styling
 * Matches the site's dark card aesthetic
 */

/* ─── RESET GF DEFAULTS ─── */
.gform_wrapper.gravity-theme {
    font-family: var(--font-primary) !important;
}

.gform_wrapper.gravity-theme .gform_body {
    font-size: var(--font-size-base);
}

/* ─── LABELS ─── */
.gform_wrapper.gravity-theme .gfield_label,
.gform_wrapper.gravity-theme .gfield_label .gfield_required {
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.gform_wrapper.gravity-theme .gfield_required {
    color: var(--color-accent);
}

/* ─── INPUTS (dark card context) ─── */
.gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.gform_wrapper.gravity-theme select,
.gform_wrapper.gravity-theme textarea {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: var(--radius-md) !important;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary) !important;
    font-size: 0.95rem !important;
    padding: 12px 16px !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
    -webkit-appearance: none;
}

.gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]):focus,
.gform_wrapper.gravity-theme select:focus,
.gform_wrapper.gravity-theme textarea:focus {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 3px var(--color-accent-light) !important;
    outline: none !important;
}

.gform_wrapper.gravity-theme input::placeholder,
.gform_wrapper.gravity-theme textarea::placeholder {
    color: var(--color-text-muted) !important;
}

/* Select arrow */
.gform_wrapper.gravity-theme select {
    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='M2 4l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    padding-right: 40px !important;
}

/* ─── SUBMIT BUTTON (matches source: w-full bg-[#C26D28] hover:bg-[#d47a35] text-white py-4 font-semibold) ─── */
.gform_wrapper .gform_footer input[type="submit"],
.gform_wrapper .gform_page_footer input[type="submit"],
.gform_wrapper .gform_button,
.gform_wrapper.gravity-theme .gform_footer input[type="submit"],
.gform_wrapper.gravity-theme .gform_page_footer input[type="submit"],
.gform_wrapper.gravity-theme .gform_button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--color-accent) !important;
    color: var(--color-text-primary) !important;
    font-family: var(--font-primary) !important;
    font-size: 1rem !important;
    font-weight: var(--font-weight-semibold) !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    width: 100% !important;
    white-space: nowrap !important;
    transition: background-color var(--transition-fast) !important;
}

.gform_wrapper .gform_footer input[type="submit"]:hover,
.gform_wrapper .gform_page_footer input[type="submit"]:hover,
.gform_wrapper .gform_button:hover,
.gform_wrapper.gravity-theme .gform_footer input[type="submit"]:hover,
.gform_wrapper.gravity-theme .gform_page_footer input[type="submit"]:hover,
.gform_wrapper.gravity-theme .gform_button:hover {
    background-color: var(--color-accent-hover) !important;
    color: var(--color-text-primary) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ─── CATCH-ALL: any submit inside consultation/sidebar wrappers ─── */
.consultation-form-wrapper input[type="submit"],
.sidebar-form-card input[type="submit"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: var(--color-accent) !important;
    color: #fff !important;
    font-family: var(--font-primary) !important;
    font-size: 1rem !important;
    font-weight: var(--font-weight-semibold) !important;
    line-height: 1 !important;
    text-transform: none !important;
    padding: 16px !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    width: 100% !important;
    white-space: nowrap !important;
    transition: background-color var(--transition-fast) !important;
}

.consultation-form-wrapper input[type="submit"]:hover,
.sidebar-form-card input[type="submit"]:hover {
    background-color: var(--color-accent-hover) !important;
}

/* ─── VALIDATION ─── */
.gform_wrapper.gravity-theme .gfield_error input,
.gform_wrapper.gravity-theme .gfield_error select,
.gform_wrapper.gravity-theme .gfield_error textarea {
    border-color: #ef4444 !important;
}

.gform_wrapper.gravity-theme .gfield_error .gfield_label {
    color: #ef4444 !important;
}

.gform_wrapper.gravity-theme .validation_message,
.gform_wrapper.gravity-theme .gfield_description.validation_message {
    color: #ef4444 !important;
    font-size: 0.85rem !important;
    padding: 4px 0 !important;
    background: none !important;
    border: none !important;
}

.gform_wrapper.gravity-theme .validation_error {
    color: #ef4444 !important;
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
    border-radius: var(--radius-md) !important;
    padding: 12px 16px !important;
    font-size: 0.9rem !important;
    margin-bottom: 20px !important;
}

/* ─── CONFIRMATION MESSAGE ─── */
.gform_wrapper.gravity-theme .gform_confirmation_message {
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    border-radius: var(--radius-md) !important;
    padding: 20px !important;
    font-size: 1rem !important;
    text-align: center !important;
}

/* ─── FIELD SPACING ─── */
.gform_wrapper.gravity-theme .gfield {
    margin-bottom: 16px !important;
}

/* ─── DESCRIPTION TEXT ─── */
.gform_wrapper.gravity-theme .gfield_description:not(.validation_message) {
    color: var(--color-text-muted) !important;
    font-size: 0.85rem !important;
}

/* ─── SIDEBAR FORM CONTEXT (white card background) ─── */
.sidebar-form-card .gform_wrapper .gfield_label,
.sidebar-form-card .gform_wrapper.gravity-theme .gfield_label {
    color: var(--color-light-text-primary) !important;
    font-size: 0.85rem !important;
}

.sidebar-form-card .gform_wrapper .gfield_label .gfield_required,
.sidebar-form-card .gform_wrapper.gravity-theme .gfield_label .gfield_required {
    color: var(--color-accent) !important;
}

.sidebar-form-card .gform_wrapper .gfield,
.sidebar-form-card .gform_wrapper.gravity-theme .gfield {
    margin-bottom: 10px !important;
}

.sidebar-form-card .gform_wrapper input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.sidebar-form-card .gform_wrapper select,
.sidebar-form-card .gform_wrapper textarea,
.sidebar-form-card .gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]):not([type="image"]):not([type="file"]),
.sidebar-form-card .gform_wrapper.gravity-theme select,
.sidebar-form-card .gform_wrapper.gravity-theme textarea {
    background-color: var(--color-light-bg) !important;
    border: none !important;
    border-bottom: 1px solid var(--color-light-border-hover) !important;
    border-radius: 0 !important;
    color: var(--color-light-text-primary) !important;
    padding: 10px 0 !important;
    font-size: 0.9rem !important;
}

.sidebar-form-card .gform_wrapper input:focus,
.sidebar-form-card .gform_wrapper select:focus,
.sidebar-form-card .gform_wrapper textarea:focus,
.sidebar-form-card .gform_wrapper.gravity-theme input:focus,
.sidebar-form-card .gform_wrapper.gravity-theme select:focus,
.sidebar-form-card .gform_wrapper.gravity-theme textarea:focus {
    border-bottom-color: var(--color-accent) !important;
    box-shadow: none !important;
    outline: none !important;
}

.sidebar-form-card .gform_wrapper input::placeholder,
.sidebar-form-card .gform_wrapper textarea::placeholder,
.sidebar-form-card .gform_wrapper.gravity-theme input::placeholder,
.sidebar-form-card .gform_wrapper.gravity-theme textarea::placeholder {
    color: #9ca3af !important;
}

.sidebar-form-card .gform_wrapper .gfield_description:not(.validation_message),
.sidebar-form-card .gform_wrapper.gravity-theme .gfield_description:not(.validation_message) {
    color: var(--color-light-text-muted) !important;
}

/* ─── WHITE/LIGHT BACKGROUND CONTEXT (reviews, blog, practice-areas pages) ─── */
.section--white .gform_wrapper.gravity-theme .gfield_label,
.section--light .gform_wrapper.gravity-theme .gfield_label,
.section--light-alt .gform_wrapper.gravity-theme .gfield_label,
.reviews-content .gform_wrapper.gravity-theme .gfield_label {
    color: var(--color-light-text-primary);
}

.section--white .gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]),
.section--white .gform_wrapper.gravity-theme select,
.section--white .gform_wrapper.gravity-theme textarea,
.section--light .gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]),
.section--light .gform_wrapper.gravity-theme select,
.section--light .gform_wrapper.gravity-theme textarea,
.section--light-alt .gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]),
.section--light-alt .gform_wrapper.gravity-theme select,
.section--light-alt .gform_wrapper.gravity-theme textarea,
.reviews-content .gform_wrapper.gravity-theme input:not([type="radio"]):not([type="checkbox"]):not([type="submit"]):not([type="button"]),
.reviews-content .gform_wrapper.gravity-theme select,
.reviews-content .gform_wrapper.gravity-theme textarea {
    background-color: var(--color-light-bg-alt) !important;
    border: 1px solid var(--color-light-border-hover) !important;
    color: var(--color-light-text-primary) !important;
}

.section--white .gform_wrapper.gravity-theme input::placeholder,
.section--white .gform_wrapper.gravity-theme textarea::placeholder,
.section--light .gform_wrapper.gravity-theme input::placeholder,
.section--light .gform_wrapper.gravity-theme textarea::placeholder,
.section--light-alt .gform_wrapper.gravity-theme input::placeholder,
.section--light-alt .gform_wrapper.gravity-theme textarea::placeholder,
.reviews-content .gform_wrapper.gravity-theme input::placeholder,
.reviews-content .gform_wrapper.gravity-theme textarea::placeholder {
    color: #9ca3af !important;
}

/* ─── FOOTER ─── */
.gform_wrapper.gravity-theme .gform_footer {
    padding: 8px 0 0 !important;
    margin: 0 !important;
}

/* ─── HONEYPOT ─── */
.gform_wrapper.gravity-theme .gform_validation_container {
    display: none !important;
}
