/* ========================================
   RIGICON VENTURES - GRAVITY FORMS STYLES
   Matches the custom HTML form design
   ======================================== */

/* Form Container */
.gform_wrapper.gravity-theme {
    max-width: 900px;
    margin: var(--spacing-lg, 1.5rem) auto 0;
}

.gform_wrapper form {
    margin: 0;
}

/* Form Body */
.gform_body {
    padding: 0;
}

/* Form Fields List - Use Gravity Forms Native Grid */
.gform_fields {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Field Container - Let Gravity Forms handle layout */
.gfield {
    margin-bottom: 18px !important;
    padding: 0 !important;
}

/* Gravity Forms native grid handles width classes (.gfield--width-half, .gfield--width-full) */


/* Labels - Including Legend (Name field) */
.gfield_label,
.gform_wrapper fieldset legend.gfield_label,
.gform_wrapper legend.gform-field-label {
    display: block !important;
    font-weight: 600 !important;
    color: #232F58 !important;
    margin-bottom: 6px !important;
    font-size: 0.9rem !important;
    font-family: 'Montserrat', sans-serif !important;
}

/* Required Indicator */
.gfield_required {
    color: #ce122d;
    margin-left: 2px;
}

/* 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 select,
.gform_wrapper textarea {
    width: 100% !important;
    padding: 12px 16px !important;
    border: 2px solid rgba(18, 79, 144, 0.15) !important;
    border-radius: 8px !important;
    font-family: 'Montserrat', sans-serif !important;
    font-size: 0.95rem !important;
    color: #232F58 !important;
    background: white !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !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 select:focus,
.gform_wrapper textarea:focus {
    outline: none !important;
    border-color: #124f90 !important;
    box-shadow: 0 0 0 3px rgba(18, 79, 144, 0.1) !important;
}

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

/* Select Dropdown */
.gform_wrapper select {
    appearance: none;
    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 fill='%23232F58' d='M6 9L1 4h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 40px !important;
}

/* Checkbox & Radio Fields */
.gfield_checkbox,
.gfield_radio {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.gfield_checkbox li,
.gfield_radio li {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 1rem !important;
}

.gform_wrapper input[type="checkbox"],
.gform_wrapper input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    margin: 4px 0 0 0 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    accent-color: #124f90 !important;
}

.gfield_checkbox label,
.gfield_radio label {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: #232F58 !important;
    cursor: pointer !important;
    flex: 1 !important;
    font-weight: 400 !important;
    margin: 0 !important;
}

/* Consent Fields Styling - Form 11 Only */
#field_11_12 .gfield_consent_label,
#field_11_13 .gfield_consent_label,
#field_11_18 .gfield_consent_label {
    font-size: 0.9rem !important;
    line-height: 1.6 !important;
    color: #232F58 !important;
    font-weight: 400 !important;
}

/* Submit Button */
.gform_footer,
.gform_page_footer {
    margin-top: 1.5rem !important;
    padding: 0 !important;
}

.gform_wrapper .gform_button,
.gform_wrapper .gform_next_button,
.gform_wrapper .gform_previous_button {
    display: inline-block !important;
    padding: 16px 36px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    font-family: 'Montserrat', sans-serif !important;
    letter-spacing: 0.3px !important;
    background: linear-gradient(135deg, #ce122d 0%, #b00f25 100%) !important;
    color: white !important;
    box-shadow: 0 4px 16px rgba(206, 18, 45, 0.2) !important;
    transition: all 0.3s ease !important;
}

.gform_wrapper .gform_button:hover,
.gform_wrapper .gform_next_button:hover {
    background: linear-gradient(135deg, #b00f25 0%, #9a0d20 100%) !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 24px rgba(206, 18, 45, 0.35) !important;
}

/* Validation Errors */
.gform_wrapper .gfield_error {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 18px !important;
}

.gform_wrapper .gfield_error input,
.gform_wrapper .gfield_error select,
.gform_wrapper .gfield_error textarea {
    border-color: #ce122d !important;
}

.gform_wrapper .validation_message {
    color: #ce122d !important;
    font-size: 0.85rem !important;
    margin-top: 6px !important;
    font-weight: 500 !important;
}

/* Confirmation Message */
.gform_confirmation_wrapper {
    background: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    color: #155724 !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    margin-top: 1rem !important;
    text-align: center !important;
}

/* Form Note/Description */
.gform_wrapper .gform_description,
.gform_wrapper .gfield_description {
    margin-top: 0.5rem !important;
    padding: 14px !important;
    background: rgba(255, 255, 255, 0.6) !important;
    border-radius: 8px !important;
    color: #232F58 !important;
    font-size: 0.85rem !important;
    text-align: center !important;
    border: 1px solid rgba(18, 79, 144, 0.1) !important;
    font-weight: 500 !important;
}

/* Remove Default Gravity Forms Styling */
.gform_wrapper ul.gfield_checkbox li input[type="checkbox"],
.gform_wrapper ul.gfield_radio li input[type="radio"] {
    margin-top: 4px !important;
}

.gform_wrapper .top_label .gfield_label {
    margin-bottom: 6px !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gform_wrapper.gravity-theme {
        max-width: 100%;
    }
    
    /* Gravity Forms handles responsive layout with native classes */
    
    .gform_wrapper .gform_button,
    .gform_wrapper .gform_next_button,
    .gform_wrapper .gform_previous_button {
        width: 100% !important;
        text-align: center !important;
    }
}

/* Required Indicator Styling */
.gform_wrapper .gfield_required,
.gform_wrapper .gfield_required_asterisk {
    color: #ce122d !important;
    margin-left: 2px !important;
    font-weight: 600 !important;
}

/* Show the asterisk or required text */
.gfield_label .gfield_required {
    display: inline !important;
}

/* Hide the "(Required)" text, show only * */
.gform_wrapper .gfield_required_text {
    font-size: 0 !important; /* Hide text */
}

.gform_wrapper .gfield_required_text::before {
    content: "*" !important;
    font-size: 0.9rem !important;
    color: #ce122d !important;
    font-weight: 600 !important;
}

/* ========================================
   GRAVITY FORMS NATIVE LAYOUT
   All grid/column layouts handled by GF
   - .gform-grid-row
   - .gform-grid-col
   - .ginput_container_name
   - .gfield--width-half
   - .gfield--width-full
   ======================================== */


/* Remove Gravity Forms Padding/Margins */
.gform_wrapper .gfield_label,
.gform_wrapper .ginput_container {
    margin: 0 !important;
}

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

/* Placeholder Styling */
.gform_wrapper input::placeholder,
.gform_wrapper textarea::placeholder {
    color: #8a8a8a !important;
    opacity: 0.7 !important;
}

/* Loading Spinner */
.gform_ajax_spinner {
    margin-left: 10px !important;
}

/* ========================================
   GRAVITY FORMS NATIVE GRID SYSTEM
   Support for GF's built-in grid classes
   ======================================== */

/* Gravity Forms Grid Row */
.gform_wrapper .gform-grid-row {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin-bottom: 0 !important;
}

/* Gravity Forms Grid Columns */
.gform_wrapper .gform-grid-col {
    display: flex !important;
    flex-direction: column !important;
}

.gform_wrapper .gform-grid-col--size-auto {
    flex: 1 !important;
}

/* Name Field Complex Container */
.gform_wrapper .ginput_container_name.ginput_container--name {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
}

/* Name Field Sub-labels */
.gform_wrapper .name_first,
.gform_wrapper .name_last {
    display: flex !important;
    flex-direction: column-reverse !important;
}

.gform_wrapper .gform-field-label--type-sub {
    font-size: 0.75rem !important;
    color: #666 !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    margin-top: 4px !important;
}

/* Fieldset (Name, Consent fields) */
.gform_wrapper fieldset {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 18px !important;
}

/* Legend styling is defined above with .gfield_label */

/* Hidden Label for Consent */
.gform_wrapper .hidden_label legend {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border-width: 0 !important;
}

/* Inline Consent Label */
.gform_wrapper .gform-field-label--type-inline {
    display: inline !important;
    font-weight: 400 !important;
    margin: 0 !important;
}

/* Consent Container */
.gform_wrapper .ginput_container_consent {
    align-items: flex-start !important;
    gap: 12px !important;
}

.gform_wrapper .ginput_container_consent input[type="checkbox"] {
    margin-top: 4px !important;
    flex-shrink: 0 !important;
}

/* Conditional Logic Hidden Fields */
.gform_wrapper .gfield[data-conditional-logic="hidden"] {
    display: none !important;
}

/* Select Placeholder Styling */
.gform_wrapper select option.gf_placeholder {
    color: #999 !important;
}

/* State Field Conditional Display */
.gform_wrapper select[disabled] {
    background-color: #f5f5f5 !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
}

/* Form Title & Description (if shown) */
.gform_wrapper .gform_title {
    display: none !important; /* Hide since we have our own title */
}

.gform_wrapper .gform_description {
    display: none !important; /* Hide since we have our own description */
}

/* AJAX Loading State */
.gform_wrapper.gform_validation_error {
    border: none !important;
}

.gform_wrapper .gform_validation_errors {
    background: #fff3cd !important;
    border: 1px solid #ffc107 !important;
    color: #856404 !important;
    padding: 1rem !important;
    border-radius: 8px !important;
    margin-bottom: 1.5rem !important;
}

/* Hidden Inputs */
.gform_wrapper .gform_hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS FOR NATIVE GRID
   ======================================== */

@media (max-width: 768px) {
    /* Gravity Forms handles all responsive grid adjustments */
    /* No custom overrides needed */
}

/* ========================================
   CONSENT FIELDS STYLING - FORM 11 ONLY
   ======================================== */

/* Consent container - only for form 11 fields 12, 13 and 18 */
#field_11_12 .ginput_container_consent,
#field_11_13 .ginput_container_consent,
#field_11_18 .ginput_container_consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

/* Consent checkbox - only for form 11 */
#input_11_12_1,
#input_11_13_1,
#input_11_18_1 {
    flex-shrink: 0;
    margin: 4px 0 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-red);
}

/* Consent label - only for form 11 */
#field_11_12 .gfield_consent_label,
#field_11_13 .gfield_consent_label,
#field_11_18 .gfield_consent_label {
    flex: 1;
    margin: 0 !important;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
    font-weight: 400;
    text-align: left;
}

/* Links in consent text - form 11 only */
#field_11_12 .gfield_consent_label a,
#field_11_13 .gfield_consent_label a,
#field_11_18 .gfield_consent_label a {
    color: var(--primary-blue);
    text-decoration: underline;
}

#field_11_12 .gfield_consent_label a:hover,
#field_11_13 .gfield_consent_label a:hover,
#field_11_18 .gfield_consent_label a:hover {
    color: var(--accent-red);
}

/* Required text in consent - form 11 only */
#field_11_12 .gfield_consent_label .gfield_required_text,
#field_11_13 .gfield_consent_label .gfield_required_text,
#field_11_18 .gfield_consent_label .gfield_required_text {
    color: var(--accent-red);
    font-size: 0.85rem;
}

/* Consent field legend - form 11 only */
#field_11_12 .gfield_label,
#field_11_13 .gfield_label,
#field_11_18 .gfield_label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-blue);
    margin-bottom: 8px;
}

/* ========================================
   HIDE RECAPTCHA BADGE
   ======================================== */

.grecaptcha-badge {
    display: none !important;
}

/* ========================================
   RTL SUPPORT (Arabic)
   ======================================== */

/* Required Indicator - flip margin */
[dir="rtl"] .gfield_required {
    margin-left: 0;
    margin-right: 2px;
}

[dir="rtl"] .gform_wrapper .gfield_required,
[dir="rtl"] .gform_wrapper .gfield_required_asterisk {
    margin-left: 0 !important;
    margin-right: 2px !important;
}

/* Select Dropdown Arrow - flip to left side */
[dir="rtl"] .gform_wrapper select {
    background-position: left 12px center !important;
    padding-right: 16px !important;
    padding-left: 40px !important;
}

/* AJAX Spinner - flip margin */
[dir="rtl"] .gform_ajax_spinner {
    margin-left: 0 !important;
    margin-right: 10px !important;
}

/* Consent Label - text align */
[dir="rtl"] #field_11_12 .gfield_consent_label,
[dir="rtl"] #field_11_13 .gfield_consent_label,
[dir="rtl"] #field_11_18 .gfield_consent_label {
    text-align: right;
}
