/* ==========================================================================
   COMPACT 3-COLUMN DESKTOP GRID (VERTICAL SPACE OPTIMIZED)
   ========================================================================== */

/* Outer Blueprint Wrapper Panel */
.custom-quote-form-container {
    width: 100%;
    max-width: 960px;
    /* Tight desktop box layout constraints */
    margin: 0 auto;
    padding: 15px 20px;
    /* Cut padding in half to save vertical screen space */
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Header Text Rules */
.form-header-row {
    text-align: center;
    margin-bottom: 15px;
    /* Reduced margin gaps */
}

.form-header-row .quote-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 24px;
    /* Slightly smaller header typography footprint */
    font-weight: 800;
    color: #F5A623;
    text-transform: uppercase;
    margin: 0;
}

.form-header-row .quote-title .title-dark {
    color: #000000;
}

/* Forceful Desktop Flex Container (Strictly 3-Columns) */
.form-flex-row {
    display: flex;
    flex-direction: row;
    /* Enforces horizontal tracking alignment */
    flex-wrap: nowrap;
    /* Blocks accidental wrapping lines on desktop */
    gap: 12px;
    /* Tight spacing bringing field elements closer */
    margin-bottom: 12px;
    /* Compressed margins between field block rows */
    width: 100%;
}

/* Split math calculation targeting individual row element pieces */
.form-flex-row.col-3 .form-field-group {
    flex: 1 1 33.333%;
    width: 33.333%;
}

/* Mixed Asymmetrical Row Grid Controls */
.form-flex-row.mixed-row .col-quarter {
    flex: 1 1 25%;
    width: 25%;
}

.form-flex-row.mixed-row .col-half {
    flex: 1 1 50%;
    width: 50%;
}

/* Layout adjustments inside the groups */
.form-field-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.form-field-group .quote-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #333333;
    margin-bottom: 4px;
}

/* Input Fields Styling Framework */
.custom-quote-form-container input[type="text"],
.custom-quote-form-container input[type="email"],
.custom-quote-form-container input[type="date"],
.custom-quote-form-container select,
.custom-quote-form-container textarea {
    width: 100%;
    height: 40px;
    /* Reduced input height wrapper parameters */
    padding: 6px 12px;
    background-color: #ffffff;
    border: 1px solid #4A90E2;
    border-radius: 4px;
    font-size: 14px;
    color: #222222;
    box-sizing: border-box;
}

/* Compact Textarea alignment parameters */
.custom-quote-form-container textarea {
    height: 65px;
    /* Shaved down height properties to prevent screen takeover */
    resize: none;
}

/* Strip away default iOS/Safari padding bugs on date fields */
.custom-quote-form-container input[type="date"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 0 !important;
    /* Prevents input fields from inflating past container walls */
}

/* Submit Action Button Core Layout Rules */
.form-submit-row {
    width: 100%;
    text-align: center;
    margin-top: 5px;
}

.custom-quote-form-container input[type="submit"] {
    width: 100%;
    height: 46px;
    /* Streamlined submit action height */
    background-color: #3B5998;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.custom-quote-form-container input[type="submit"]:hover {
    background-color: #2D4373;
}

/* ==========================================================================
   MOBILE MEDIA DRIVER BREAKPOINTS (Collapses gracefully under 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {

    /* Allow compressed rows to break into single rows on phones */
    .form-flex-row {
        flex-wrap: wrap !important;
        /* Forces layout boxes to stack cleanly */
        gap: 15px;
    }

    /* Ensure every single field group drops down to clean 100% viewport width */
    .form-flex-row.col-3 .form-field-group,
    .form-flex-row.mixed-row .col-quarter,
    .form-flex-row.mixed-row .col-half {
        flex: 1 1 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .custom-quote-form-container textarea {
        height: 90px;
        /* Slightly taller textarea for better mobile input */
    }
}