/**
 * Gravity Forms Custom Styling
 * Form ID 5 - Roofing Quote Calculator
 */

/* ==========================================================================
   Form Container
   ========================================================================== */

#gform_wrapper_5 {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

#gform_wrapper_5 .gform_body {
    padding: 0;
}

/* ==========================================================================
   Step Headers / Section Titles
   ========================================================================== */

#gform_wrapper_5 .gsection {
    border: none;
    padding: 0;
    margin: 0 0 25px 0;
}

#gform_wrapper_5 .gsection_title,
#gform_wrapper_5 .gfield--type-section .gsection_title {
    font-family: 'Lato', 'Arial', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #1e428b;
    margin: 0 0 10px 0;
    padding: 0 0 15px 0;
    border-bottom: 2px solid #0195c8;
    display: block;
}

#gform_wrapper_5 .gsection_description {
    font-size: 15px;
    color: #666;
    margin-top: 10px;
    line-height: 1.6;
}

/* ==========================================================================
   Field Labels
   ========================================================================== */

#gform_wrapper_5 .gfield_label,
#gform_wrapper_5 .gform-field-label {
    font-family: 'Lato', 'Arial', sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1e428b;
    margin-bottom: 8px;
    display: block;
}

#gform_wrapper_5 .gfield_required {
    color: #e74c3c;
    margin-left: 3px;
}

#gform_wrapper_5 .gfield_description {
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    font-style: italic;
}

/* ==========================================================================
   Image-Based Radio Buttons (Roof Type Selection)
   ========================================================================== */

#gform_wrapper_5 .gfield--type-radio .ginput_container_radio,
#gform_wrapper_5 .gfield--type-choice .ginput_container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 15px;
}

#gform_wrapper_5 .gfield--type-radio .gchoice,
#gform_wrapper_5 .gfield--type-choice .gchoice {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
}

#gform_wrapper_5 .gfield--type-radio .gchoice input[type="radio"],
#gform_wrapper_5 .gfield--type-choice .gchoice input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

#gform_wrapper_5 .gfield--type-radio .gchoice label,
#gform_wrapper_5 .gfield--type-choice .gchoice label {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    text-align: center;
}

#gform_wrapper_5 .gfield--type-radio .gchoice label:hover,
#gform_wrapper_5 .gfield--type-choice .gchoice label:hover {
    border-color: #0195c8;
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(1, 149, 200, 0.15);
}

#gform_wrapper_5 .gfield--type-radio .gchoice input[type="radio"]:checked + label,
#gform_wrapper_5 .gfield--type-choice .gchoice input[type="radio"]:checked + label {
    border-color: #0195c8;
    background: linear-gradient(135deg, #e8f4fc 0%, #d4edfc 100%);
    box-shadow: 0 4px 15px rgba(1, 149, 200, 0.25);
}

#gform_wrapper_5 .gfield--type-radio .gchoice input[type="radio"]:checked + label::after,
#gform_wrapper_5 .gfield--type-choice .gchoice input[type="radio"]:checked + label::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: #0195c8;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

#gform_wrapper_5 .gfield--type-radio .gchoice label img,
#gform_wrapper_5 .gfield--type-choice .gchoice label img {
    max-width: 120px;
    height: auto;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

#gform_wrapper_5 .gfield--type-radio .gchoice label:hover img,
#gform_wrapper_5 .gfield--type-choice .gchoice label:hover img {
    transform: scale(1.05);
}

/* Radio button label text */
#gform_wrapper_5 .gfield--type-radio .gchoice label span,
#gform_wrapper_5 .gfield--type-choice .gchoice label span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

/* ==========================================================================
   Measurement Diagram Container
   ========================================================================== */

#gform_wrapper_5 .gfield--type-html {
    margin: 25px 0;
}

#gform_wrapper_5 .gfield--type-html img {
    max-width: 350px;
    height: auto;
    display: block;
    margin: 0 auto 20px;
}

/* ==========================================================================
   Number Input Fields (Measurements)
   ========================================================================== */

#gform_wrapper_5 .gfield--type-number {
    margin-bottom: 25px;
}

#gform_wrapper_5 .gfield--type-number .ginput_container_number {
    position: relative;
}

#gform_wrapper_5 .gfield--type-number input[type="number"],
#gform_wrapper_5 input[type="text"],
#gform_wrapper_5 input[type="email"],
#gform_wrapper_5 input[type="tel"],
#gform_wrapper_5 select,
#gform_wrapper_5 textarea {
    width: 100%;
    max-width: 200px;
    padding: 14px 18px;
    font-family: 'Lato', 'Arial', sans-serif;
    font-size: 16px;
    color: #333;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}

#gform_wrapper_5 input[type="number"]::-webkit-outer-spin-button,
#gform_wrapper_5 input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#gform_wrapper_5 input:focus,
#gform_wrapper_5 select:focus,
#gform_wrapper_5 textarea:focus {
    outline: none;
    border-color: #0195c8;
    box-shadow: 0 0 0 3px rgba(1, 149, 200, 0.15);
}

/* Unit label (Metres) */
#gform_wrapper_5 .gfield_description.gfield_description--below {
    font-size: 13px;
    color: #666;
    font-style: normal;
    font-weight: 500;
    margin-top: 6px;
}

/* ==========================================================================
   Multi-Column Measurement Layout
   ========================================================================== */

#gform_wrapper_5 .gform_fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Two column layout for measurement fields */
#gform_wrapper_5 .gfield.gfield--width-half {
    grid-column: span 1;
}

@media (min-width: 768px) {
    #gform_wrapper_5 .gform_fields {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #gform_wrapper_5 .gfield.gfield--width-full,
    #gform_wrapper_5 .gsection,
    #gform_wrapper_5 .gfield--type-section,
    #gform_wrapper_5 .gfield--type-html,
    #gform_wrapper_5 .gfield--type-radio,
    #gform_wrapper_5 .gfield--type-choice {
        grid-column: span 2;
    }
}

/* ==========================================================================
   Measurement Input with Label Box
   ========================================================================== */

#gform_wrapper_5 .gfield--measurement {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

#gform_wrapper_5 .gfield--measurement .gfield_label {
    background: #1e428b;
    color: #fff;
    display: inline-block;
    padding: 6px 14px;
    border-radius: 5px;
    font-size: 14px;
    margin-bottom: 12px;
}

/* ==========================================================================
   Checkbox Fields
   ========================================================================== */

#gform_wrapper_5 .gfield--type-checkbox .ginput_container_checkbox {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

#gform_wrapper_5 .gfield--type-checkbox .gchoice {
    display: flex;
    align-items: center;
    gap: 12px;
}

#gform_wrapper_5 .gfield--type-checkbox input[type="checkbox"] {
    width: 22px;
    height: 22px;
    accent-color: #0195c8;
    cursor: pointer;
}

#gform_wrapper_5 .gfield--type-checkbox label {
    font-size: 15px;
    color: #333;
    cursor: pointer;
}

/* ==========================================================================
   Select Dropdowns
   ========================================================================== */

#gform_wrapper_5 select {
    max-width: 100%;
    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='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* ==========================================================================
   Submit Button
   ========================================================================== */

#gform_wrapper_5 .gform_footer,
#gform_wrapper_5 .gform_page_footer {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#gform_wrapper_5 input[type="submit"],
#gform_wrapper_5 .gform_button,
#gform_wrapper_5 .gform_next_button {
    background: linear-gradient(135deg, #0195c8 0%, #1e428b 100%);
    color: #fff;
    font-family: 'Lato', 'Arial', sans-serif;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#gform_wrapper_5 input[type="submit"]:hover,
#gform_wrapper_5 .gform_button:hover,
#gform_wrapper_5 .gform_next_button:hover {
    background: linear-gradient(135deg, #017ba6 0%, #163570 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 149, 200, 0.35);
}

#gform_wrapper_5 .gform_previous_button {
    background: #f0f0f0;
    color: #333;
    font-family: 'Lato', 'Arial', sans-serif;
    font-size: 16px;
    font-weight: 600;
    padding: 16px 30px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#gform_wrapper_5 .gform_previous_button:hover {
    background: #e5e5e5;
    border-color: #ccc;
}

/* ==========================================================================
   Multi-Page Progress Bar
   ========================================================================== */

#gform_wrapper_5 .gf_progressbar_wrapper {
    margin-bottom: 40px;
}

#gform_wrapper_5 .gf_progressbar_title {
    font-size: 14px;
    font-weight: 600;
    color: #1e428b;
    margin-bottom: 10px;
}

#gform_wrapper_5 .gf_progressbar {
    background: #e8e8e8;
    border-radius: 20px;
    height: 12px;
    overflow: hidden;
}

#gform_wrapper_5 .gf_progressbar_percentage {
    background: linear-gradient(135deg, #0195c8 0%, #1e428b 100%);
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
}

#gform_wrapper_5 .gf_progressbar_percentage span {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

/* ==========================================================================
   Step Numbers (Alternative Progress)
   ========================================================================== */

#gform_wrapper_5 .gf_page_steps {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

#gform_wrapper_5 .gf_step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f0f0f0;
    border-radius: 25px;
    font-size: 14px;
    color: #666;
    transition: all 0.3s ease;
}

#gform_wrapper_5 .gf_step_active {
    background: linear-gradient(135deg, #0195c8 0%, #1e428b 100%);
    color: #fff;
}

#gform_wrapper_5 .gf_step_completed {
    background: #28a745;
    color: #fff;
}

#gform_wrapper_5 .gf_step_number {
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

/* ==========================================================================
   Validation & Error Messages
   ========================================================================== */

#gform_wrapper_5 .gfield_error {
    background: #fff5f5;
    border: 1px solid #e74c3c;
    border-radius: 8px;
    padding: 15px;
}

#gform_wrapper_5 .gfield_error .gfield_label {
    color: #e74c3c;
}

#gform_wrapper_5 .gfield_error input,
#gform_wrapper_5 .gfield_error select,
#gform_wrapper_5 .gfield_error textarea {
    border-color: #e74c3c;
}

#gform_wrapper_5 .validation_message {
    font-size: 13px;
    color: #e74c3c;
    margin-top: 6px;
}

#gform_wrapper_5 .validation_error {
    background: #e74c3c;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 14px;
}

/* ==========================================================================
   Confirmation Message
   ========================================================================== */

#gform_wrapper_5 .gform_confirmation_wrapper {
    background: linear-gradient(135deg, #e8f8f0 0%, #d4f0e4 100%);
    border: 2px solid #28a745;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

#gform_wrapper_5 .gform_confirmation_message {
    font-size: 18px;
    color: #1e7e34;
    line-height: 1.6;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
    #gform_wrapper_5 {
        padding: 25px 20px;
        border-radius: 8px;
    }
    
    #gform_wrapper_5 .gsection_title,
    #gform_wrapper_5 .gfield--type-section .gsection_title {
        font-size: 20px;
    }
    
    #gform_wrapper_5 .gfield--type-radio .ginput_container_radio,
    #gform_wrapper_5 .gfield--type-choice .ginput_container {
        flex-direction: column;
        align-items: stretch;
    }
    
    #gform_wrapper_5 .gfield--type-radio .gchoice label,
    #gform_wrapper_5 .gfield--type-choice .gchoice label {
        min-width: auto;
        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;
        padding: 15px 20px;
    }
    
    #gform_wrapper_5 .gfield--type-radio .gchoice label img,
    #gform_wrapper_5 .gfield--type-choice .gchoice label img {
        max-width: 80px;
        margin-bottom: 0;
    }
    
    #gform_wrapper_5 input[type="number"],
    #gform_wrapper_5 input[type="text"],
    #gform_wrapper_5 select {
        max-width: 100%;
    }
    
    #gform_wrapper_5 .gform_footer,
    #gform_wrapper_5 .gform_page_footer {
        flex-direction: column;
    }
    
    #gform_wrapper_5 input[type="submit"],
    #gform_wrapper_5 .gform_button,
    #gform_wrapper_5 .gform_next_button,
    #gform_wrapper_5 .gform_previous_button {
        width: 100%;
        text-align: center;
    }
    
    #gform_wrapper_5 .gf_page_steps {
        flex-wrap: wrap;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    #gform_wrapper_5 {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    #gform_wrapper_5 input[type="submit"],
    #gform_wrapper_5 .gform_button {
        display: none;
    }
}
