/* UX Guidelines for Tablet Encoding (Extended) */

/* Keep Labels Muted: Use dark gray/cool muted tones */
.fi-fo-field-wrp-label label {
    color: #475569 !important; /* slate-600 */
    font-weight: 500 !important;
}
.fi-fo-field-wrp-helper-text {
    color: #64748b !important; /* Slate-500 */
    font-style: italic;
}

/* Clear Visual Hierarchy & Touch Target Awareness */
/* Make inputs pop with a distinct border, shadow, and slightly thicker hit area */
.fi-input, .fi-select-input {
    color: #0f172a !important; /* High-contrast text */
    font-weight: 600 !important;
    background-color: #ffffff !important;
    border: 1px solid #94a3b8 !important; /* Distinct dark border for empty state */
    border-radius: 0.5rem !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.2s ease-in-out !important;
}

/* Hover states to prevent missed taps */
.fi-input:hover, .fi-select-input:hover {
    border-color: #475569 !important; /* Darken border on hover */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
}

/* Distinct Focus States (Where the cursor is) */
.fi-input:focus, .fi-select-input:focus, .fi-input:focus-within, .fi-select:focus-within {
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.3) !important;
    background-color: #fffbeb !important; /* Light amber background tint */
    border-color: #ea580c !important; /* High-contrast primary border */
}

/* Reduced Input Errors: Real-Time Validation Feedback */
/* Use Filament's aria-invalid state for errors (Server-side validation) */
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] {
    border-color: #ef4444 !important; /* Red-500 */
    background-color: #fef2f2 !important; /* Light red tint */
    border-left: 4px solid #ef4444 !important; /* Strong left visual cue */
}

/* Success Validation: If an input is required and valid (and not focused), give it a subtle green left-border cue to indicate completion */
/* Using focus to prevent aggressive coloring while typing, applying when they click away */
input:required:valid:not(:focus), select:required:valid:not(:focus), textarea:required:valid:not(:focus) {
    border-left: 4px solid #10b981 !important; /* Emerald-500 */
}

/* Classic Radios and Checkboxes specific targeting for touch */
input[type="radio"], input[type="checkbox"] {
    transform: scale(1.2); /* Make them slightly larger for tablet fingers */
    margin-right: 0.25rem;
}

/* =========================================
   DARK MODE OVERRIDES
   ========================================= */
.dark .fi-fo-field-wrp-label label {
    color: #cbd5e1 !important; /* slate-300 */
}
.dark .fi-fo-field-wrp-helper-text {
    color: #94a3b8 !important; /* slate-400 */
}

.dark .fi-input, 
.dark .fi-select-input,
.dark .fi-input-wrapper,
.dark select {
    color: #f8fafc !important; /* High contrast white */
    background-color: #1e293b !important; /* slate-800 */
    border-color: #475569 !important; /* slate-600 */
}

/* Ensure the selected options / dropdown items are readable */
.dark .fi-select-option,
.dark option {
    color: #f8fafc !important;
    background-color: #1e293b !important;
}

.dark .fi-input:hover, 
.dark .fi-select-input:hover {
    border-color: #94a3b8 !important; /* Lighten border on hover in dark mode */
}

.dark .fi-input:focus, 
.dark .fi-select-input:focus, 
.dark .fi-input:focus-within, 
.dark .fi-select:focus-within {
    box-shadow: 0 0 0 4px rgba(234, 88, 12, 0.4) !important;
    background-color: #451a03 !important; /* deep amber/orange tint for dark mode */
    border-color: #ea580c !important; 
}

.dark input[aria-invalid="true"], 
.dark select[aria-invalid="true"], 
.dark textarea[aria-invalid="true"] {
    background-color: #450a0a !important; /* dark red tint */
}
