/* Form Input Responsiveness Improvements */

/* Increase clickable area and improve responsiveness */
.form-group input,
.form-group select,
.form-group textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="url"],
select,
textarea {
    /* Increase touch target */
    min-height: 48px;
    padding: 12px 16px !important;
    
    /* Improve click responsiveness */
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    
    /* Better transitions */
    transition: all 0.2s ease !important;
    
    /* Ensure proper box model */
    box-sizing: border-box;
    
    /* Improve text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    /* Ensure inputs are above other elements */
    position: relative;
    z-index: 5;
    
    /* Remove iOS input shadows */
    -webkit-box-shadow: none !important;
    
    /* Cursor */
    cursor: text;
}

/* Select specific styling */
select {
    cursor: pointer;
    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='currentColor' 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 !important;
}

/* Improve focus states */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none !important;
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2) !important;
    background-color: #fffefa !important;
}

/* Hover states for better feedback */
.form-group input:hover:not(:focus),
.form-group select:hover:not(:focus),
.form-group textarea:hover:not(:focus),
input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: #ccc;
    background-color: #fafafa;
}

/* Active state for immediate feedback */
.form-group input:active,
.form-group select:active,
.form-group textarea:active,
input:active,
select:active,
textarea:active {
    transform: scale(0.99);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.3) !important;
}

/* Disabled state */
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

/* Textarea specific */
textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* Labels - make them clickable */
.form-group label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

/* Placeholder improvements */
input::placeholder,
textarea::placeholder {
    color: #999;
    opacity: 1;
}

/* Remove spinners from number inputs */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Autofill styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-text-fill-color: #000;
    -webkit-box-shadow: 0 0 0px 1000px #fffefa inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* Instant quote modal specific */
.instant-quote-form input,
.instant-quote-form select,
.instant-quote-form textarea {
    width: 100% !important;
    margin-bottom: 1rem;
}

/* Calculator page specific */
#concrete-form input,
#concrete-form select {
    width: 100% !important;
    max-width: 100% !important;
}

/* Mobile specific improvements */
@media (max-width: 768px) {
    /* Prevent zoom on focus (iOS) */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Larger touch targets on mobile */
    .form-group input,
    .form-group select,
    .form-group textarea,
    input,
    select,
    textarea {
        min-height: 52px;
        padding: 14px 16px !important;
    }
    
    /* Spacing between form elements */
    .form-group {
        margin-bottom: 1.5rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    input:hover:not(:focus),
    select:hover:not(:focus),
    textarea:hover:not(:focus) {
        border-color: #e0e0e0;
        background-color: white;
    }
    
    /* Faster tap response */
    input,
    select,
    textarea,
    button {
        touch-action: manipulation;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    input,
    select,
    textarea {
        border-width: 3px;
    }
    
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--gold) !important;
        outline-offset: 2px;
    }
}

/* Fix for instant quote modal inputs */
.quote-option {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
}

.size-btn {
    cursor: pointer !important;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

/* Checkbox and radio improvements */
input[type="checkbox"],
input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    margin: 0 8px 0 0 !important;
    cursor: pointer;
    vertical-align: middle;
}

/* File input improvements */
input[type="file"] {
    padding: 8px !important;
    cursor: pointer;
}

.file-label {
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.file-label:active {
    transform: scale(0.98);
}