/*
 * LMT Tires - Enhanced Form Styling
 * Mobile-First Responsive Design
 * Framework: Bootstrap 4.x compatible
 */

/* ============================================
   MOBILE FIRST (375px base - iPhone SE)
   ============================================ */

/* Contact Section Enhancements */
.contact {
    position: relative;
    padding: 30px 0;
}

.contact .bg_yeloow {
    background: linear-gradient(135deg, #f3cf2d 0%, #f7d855 100%);
    padding: 40px 20px;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.contact .titlepage {
    padding-bottom: 30px;
    margin-bottom: 0;
}

.contact .titlepage h2 {
    color: #000;
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.contact .titlepage p {
    color: #333;
    font-size: 16px;
    margin-bottom: 0;
}

/* Form Container */
.main_form {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
}

/* Form Groups */
.main_form .row {
    margin-left: -10px;
    margin-right: -10px;
}

.main_form [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
}

/* Input Fields */
.main_form .contactus,
.main_form input[type="text"],
.main_form input[type="email"],
.main_form input[type="tel"],
.main_form select,
.main_form textarea {
    width: 100%;
    height: 50px;
    padding: 12px 18px;
    margin-bottom: 18px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    color: #333;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Focus States */
.main_form .contactus:focus,
.main_form input[type="text"]:focus,
.main_form input[type="email"]:focus,
.main_form input[type="tel"]:focus,
.main_form select:focus,
.main_form textarea:focus {
    outline: none;
    border-color: #f3cf2d;
    box-shadow: 0 0 0 3px rgba(243, 207, 45, 0.2);
    background: #fffef8;
}

/* Placeholder Styling */
.main_form .contactus::placeholder,
.main_form input::placeholder,
.main_form textarea::placeholder {
    color: #999;
    font-size: 15px;
    opacity: 1;
}

/* Select Dropdown Styling */
.main_form select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.main_form select option {
    padding: 10px;
}

/* Labels */
.main_form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Textarea */
.main_form .textarea,
.main_form textarea {
    height: 140px;
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
    padding-top: 12px;
    line-height: 1.6;
}

/* Submit Button */
.main_form .send_btn,
.main_form button[type="submit"],
.main_form input[type="submit"] {
    width: 100%;
    max-width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #000 0%, #2a2a2a 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    margin-top: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.main_form .send_btn:hover,
.main_form button[type="submit"]:hover {
    background: linear-gradient(135deg, #f3cf2d 0%, #f7d855 100%);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 207, 45, 0.4);
}

.main_form .send_btn:active,
.main_form button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Required Field Indicator */
.main_form .required::after {
    content: " *";
    color: #e74c3c;
    font-weight: bold;
}

/* Form Row Spacing */
.main_form .form-row {
    margin-bottom: 20px;
}

/* Validation States */
.main_form input.error,
.main_form select.error,
.main_form textarea.error {
    border-color: #e74c3c;
    background: #fff5f5;
}

.main_form input.success,
.main_form select.success,
.main_form textarea.success {
    border-color: #27ae60;
    background: #f0fff4;
}

/* Error Messages */
.main_form .error-message {
    color: #e74c3c;
    font-size: 13px;
    margin-top: -12px;
    margin-bottom: 12px;
    display: block;
}

/* Success Message */
.main_form .success-message {
    background: #27ae60;
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
}

/* Loading State */
.main_form .send_btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.main_form .send_btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ============================================
   TABLET (768px and up)
   ============================================ */

@media (min-width: 768px) {
    .contact .bg_yeloow {
        padding: 50px 40px;
        border-radius: 16px;
    }

    .contact .titlepage {
        padding-bottom: 40px;
    }

    .contact .titlepage h2 {
        font-size: 36px;
    }

    .main_form {
        padding: 40px 35px;
    }

    .main_form .row {
        margin-left: -15px;
        margin-right: -15px;
    }

    .main_form [class*="col-"] {
        padding-left: 15px;
        padding-right: 15px;
    }

    .main_form .contactus,
    .main_form input,
    .main_form select,
    .main_form textarea {
        height: 55px;
        padding: 14px 20px;
        margin-bottom: 20px;
        font-size: 16px;
    }

    .main_form .textarea,
    .main_form textarea {
        height: 150px;
    }

    .main_form .send_btn {
        max-width: 300px;
        margin: 25px auto 0;
        display: block;
    }

    /* Two Column Layout for Some Fields */
    .main_form .col-md-6 .contactus,
    .main_form .col-md-6 input,
    .main_form .col-md-6 select {
        margin-bottom: 20px;
    }
}

/* ============================================
   DESKTOP (992px and up)
   ============================================ */

@media (min-width: 992px) {
    .contact .bg_yeloow {
        padding: 60px 50px;
    }

    .contact .titlepage h2 {
        font-size: 42px;
    }

    .main_form {
        padding: 50px 45px;
    }

    .main_form .contactus,
    .main_form input,
    .main_form select {
        height: 60px;
        padding: 16px 22px;
        font-size: 17px;
    }

    .main_form .textarea,
    .main_form textarea {
        height: 160px;
    }

    .main_form .send_btn {
        height: 60px;
        font-size: 19px;
        max-width: 350px;
    }
}

/* ============================================
   LARGE DESKTOP (1200px and up)
   ============================================ */

@media (min-width: 1200px) {
    .contact .bg_yeloow {
        padding: 70px 60px;
        border-radius: 20px;
    }

    .contact .titlepage h2 {
        font-size: 48px;
        margin-bottom: 15px;
    }

    .contact .titlepage p {
        font-size: 18px;
    }

    .main_form {
        padding: 60px 50px;
        max-width: 900px;
        margin: 0 auto;
    }

    .main_form .contactus,
    .main_form input,
    .main_form select {
        height: 67px;
        font-size: 18px;
    }

    .main_form label {
        font-size: 15px;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */

/* Focus Visible for Keyboard Navigation */
.main_form *:focus-visible {
    outline: 3px solid #f3cf2d;
    outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .contact .bg_yeloow {
        background: #fff !important;
        box-shadow: none !important;
    }

    .main_form {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }

    .main_form .send_btn {
        display: none;
    }
}

/* ============================================
   RADIO BUTTON STYLING
   ============================================ */

/* Radio button container */
.main_form input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    margin-right: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.main_form input[type="radio"]:checked {
    border-color: #f3cf2d;
    background: #f3cf2d;
}

.main_form input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.main_form input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 207, 45, 0.3);
}

/* Radio button label alignment */
.main_form p:has(input[type="radio"]) {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    line-height: 1.4;
}

.main_form input[type="radio"] + label {
    display: inline;
    margin-bottom: 0;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
    line-height: 1.4;
    padding-top: 2px;
}

/* Fallback for browsers without :has() support */
@supports not (selector(:has(*))) {
    .main_form p {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
    }
    
    .main_form p input[type="radio"] {
        margin-top: 4px;
    }
}

/* ============================================
   REQUIRED FIELD INDICATOR
   ============================================ */

/* Required field asterisk */
.main_form .required-indicator {
    color: #dc3545;
    font-weight: 700;
    margin-left: 2px;
}

/* Required field placeholder asterisk */
.main_form input[required]::placeholder,
.main_form select[required]::placeholder,
.main_form textarea[required]::placeholder {
    color: #999;
}

/* Style for labels with required fields */
.main_form label .required-indicator {
    color: #dc3545;
    font-size: 14px;
}
