/**
 * filament-shared.css — Filament-specific behaviors that aren't input chrome.
 *
 * INPUT/SELECT/TEXTAREA/LABEL/HELPER/CHECKBOX/RADIO/FILEPOND CHROME lives in forms.css —
 * single source of truth applied to BOTH custom HTML and Filament render paths.
 *
 * This file owns:
 *  - Auth page chrome (.fi-simple-layout bg + card)
 *  - Filament input prefix/suffix layout quirks
 *  - Filament-specific helper-text / label-row positioning
 *  - Search icon, password eye toggle, socialite button
 *  - Range slider (branded), x-cloak utility
 */

/* ---------- No divider between input and prefix/suffix (eye-toggle, magnify, etc) ---------- */
.fi-input-wrp-prefix,
.fi-input-wrp-suffix {
    border: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}
.fi-input-wrp-prefix svg,
.fi-input-wrp-suffix svg {
    color: #6A7675;
}

/* ---------- Allow focus glow to extend beyond filter container edges ---------- */
.fi-ta-ctn,
.fi-ta-content,
.fi-ta-content-toolbar,
.fi-ta-filters,
.fi-ta-filters > *,
.fi-ta-filters .fi-fo-component-ctn,
.fi-ta-filters .grid,
.fi-ta-pagination,
.fi-section,
.fi-section-content {
    overflow: visible !important;
}

/* ---------- Auth pages: dotted bg + card shadow ---------- */
.fi-simple-layout {
    background-image:
        radial-gradient(circle, rgba(13, 35, 56, 0.05) 1px, transparent 1px),
        linear-gradient(180deg, #F0F8F0 0%, #FFFFFF 100%) !important;
    background-size: 24px 24px, 100% 100% !important;
    background-repeat: repeat, no-repeat !important;
    background-position: 0 0, 0 0 !important;
    background-color: transparent !important;
    min-height: 100vh;
}
.fi-simple-main {
    border-radius: 16px !important;
    border: 1px solid rgba(226, 232, 240, 0.6) !important;
    box-shadow:
        0 1px 2px rgba(13, 35, 56, 0.04),
        0 12px 32px -12px rgba(13, 35, 56, 0.08) !important;
}
.fi-simple-layout .fi-fo-wizard,
.fi-simple-layout .fi-section {
    --tw-ring-shadow: 0 0 0 1px #CBD5E1 !important;
    --tw-ring-color: #CBD5E1 !important;
}

/* Auth pages: kill text-transform/letter-spacing inherited from theme */
.fi-simple-layout,
.fi-simple-layout * {
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Auth: hide red required asterisks */
.fi-simple-layout .fi-fo-field-wrp-label sup {
    display: none !important;
}

/* Auth label row: align hint/action next to label, single source of truth via forms.css owns text style */
.fi-simple-layout .fi-fo-field-wrp .flex.items-center.gap-x-3.justify-between {
    justify-content: flex-start !important;
    gap: 6px !important;
}
.fi-simple-layout .fi-fo-field-wrp-hint-action,
.fi-simple-layout .fi-fo-field-wrp-hint {
    margin-inline-start: 0 !important;
}

/* ---------- Auth back link ---------- */
.lb-auth-back {
    color: #6A7675;
    text-decoration: none;
    margin-top: 0.5rem;
}
.lb-auth-back:hover {
    color: #0D2338;
}
.fi-simple-layout a.lb-auth-back {
    color: #64748B !important;
    font-weight: 500 !important;
}
.fi-simple-layout a.lb-auth-back:hover {
    color: #51C24F !important;
}

/* ---------- Search input prefix icon (CSS-based, more reliable than Filament prefixIcon) ---------- */
.js-search-input {
    padding-left: 2rem !important;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='2' stroke='%236A7675'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z'/%3E%3C/svg%3E");
    background-position: 0.625rem center;
    background-repeat: no-repeat;
    background-size: 1rem 1rem;
}

/* ---------- HTML5 native :user-invalid + :invalid focus on raw inputs ---------- */
/* forms.css handles aria-invalid="true". This catches HTML5 validation states. */
body:not(.fi-body) input:user-invalid,
body:not(.fi-body) select:user-invalid,
body:not(.fi-body) textarea:user-invalid {
    border-color: #B91C1C !important;
}
body:not(.fi-body) input:user-invalid:focus,
body:not(.fi-body) select:user-invalid:focus,
body:not(.fi-body) textarea:user-invalid:focus {
    outline-color: #B91C1C !important;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.18) !important;
}

/* ---------- Password eye toggle (inline icon button inside input wrapper) ---------- */
.fi-simple-layout .fi-input-wrp .fi-icon-btn {
    border: 0 !important;
    background: transparent !important;
    color: #64748B !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
    align-self: stretch !important;
    width: 44px !important;
    min-width: 44px !important;
    height: auto !important;
}
.fi-simple-layout .fi-input-wrp .fi-icon-btn svg,
.fi-simple-layout .fi-input-wrp .fi-icon-btn .fi-icon-btn-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}
.fi-simple-layout .fi-input-wrp .fi-icon-btn:hover {
    color: #0F172A !important;
    background: transparent !important;
}
.fi-simple-layout .fi-input-wrp-suffix {
    border-inline-start: 0 !important;
    border-left: 0 !important;
    padding-inline-start: 0 !important;
    padding-inline-end: 0 !important;
    gap: 0 !important;
}

/* ---------- Socialite button (Sign in with Google) ---------- */
.fi-simple-layout .filament-companies-socialite-buttons {
    border-color: #E2E8F0 !important;
    background-color: #FFFFFF !important;
    color: #334155 !important;
    border-radius: 10px !important;
}
.fi-simple-layout .filament-companies-socialite-buttons:hover {
    background-color: #F8FAFC !important;
    border-color: #CBD5E1 !important;
}
.fi-simple-layout .filament-companies-socialite-buttons span {
    font-weight: 500 !important;
}

/* ---------- Auth header + trust strip ---------- */
.fi-simple-header-subheading {
    color: #64748B !important;
}
.lb-auth-trust {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: #64748B;
}
.lb-auth-trust span {
    margin: 0 4px;
}

/* ---------- Password strength meter ---------- */
.lb-pw-strength {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}
.lb-pw-strength span {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: #E2E8F0;
    transition: background 150ms ease;
}
.lb-pw-strength.weak span:nth-child(1) { background: #EF4444; }
.lb-pw-strength.medium span:nth-child(-n+2) { background: #F59E0B; }
.lb-pw-strength.strong span { background: #51C24F; }
.lb-pw-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #94A3B8;
}

/* ---------- Filepond placeholder text styling (drop-label inside drop-zone) ---------- */
/* forms.css owns the .filepond--root border/bg. This styles only the inner label text. */
.filepond--drop-label,
.filepond--drop-label label {
    color: #6A7675 !important;
    font-weight: 400 !important;
    font-size: 13px !important;
}
.filepond--label-action {
    color: #2C8E2B !important;
    text-decoration-color: transparent !important;
    font-weight: 600 !important;
}

/* Hide elements with x-cloak until Alpine has hydrated. */
[x-cloak] { display: none !important; }

/* ---------- Range slider — branded, cross-browser ---------- */
.lb-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 999px;
    outline: none;
    transition: background 150ms ease;
}
.lb-range:hover { background: #CBD5E1; }
.lb-range:focus {
    box-shadow: 0 0 0 4px rgba(81, 194, 79, 0.18);
}
.lb-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #51C24F;
    border: 3px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(13, 35, 56, 0.18);
    cursor: grab;
    transition: transform 100ms ease, box-shadow 100ms ease;
}
.lb-range::-webkit-slider-thumb:hover { transform: scale(1.08); }
.lb-range::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(0.95); box-shadow: 0 0 0 6px rgba(81, 194, 79, 0.18), 0 1px 4px rgba(13, 35, 56, 0.18); }
.lb-range::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #51C24F;
    border: 3px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(13, 35, 56, 0.18);
    cursor: grab;
    transition: transform 100ms ease;
}
.lb-range::-moz-range-thumb:hover { transform: scale(1.08); }
.lb-range::-moz-range-track {
    background: #E2E8F0;
    height: 6px;
    border-radius: 999px;
}
