/**
 * Picxly — shared form controls (text, textarea, native select, Chosen, toolbar triggers).
 * Load after dashboard-revamp.css or alongside revamp-theme.css on auth pages.
 */
:root {
    --picxly-field-font-size: 14px;
    --picxly-field-radius: 12px;
    --picxly-field-border: 1.5px solid #e2e8f0;
    --picxly-field-bg: #f8fafc;
    --picxly-field-bg-focus: #fff;
    --picxly-field-color: #1a202c;
    --picxly-field-accent: #4fd1c5;
    --picxly-field-focus-ring: 0 0 0 4px rgba(79, 209, 197, 0.12);
    --picxly-field-padding-y: 12px;
    --picxly-field-padding-x: 16px;
    --picxly-field-primary: #009e6b;
    --picxly-label-color: #1a202c;
    --picxly-label-muted: #718096;
}

/* ---- Labels (dashboard modals + customer form) ---- */
.form-label,
.modal-field-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--picxly-label-color);
    margin-bottom: 8px;
}

/* ---- Core field appearance ---- */
.picxly-field,
.input-custom,
.search-input,
textarea.form-control,
textarea.form-control-modern,
select.form-control,
input.form-control[type="text"],
input.form-control[type="email"],
input.form-control[type="tel"],
input.form-control[type="number"],
input.form-control[type="password"],
input.form-control[type="search"],
input.form-control[type="url"],
input.form-control[type="date"],
input.form-control[type="datetime-local"],
input.form-control[type="time"],
input.form-control[type="month"],
input.form-control-modern[type="text"],
input.form-control-modern[type="email"],
input.form-control-modern[type="tel"],
input.form-control-modern[type="number"],
input.form-control-modern[type="password"],
input.form-control-modern[type="search"],
input.form-control-modern[type="url"],
input.form-control-modern[type="date"] {
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    font-size: var(--picxly-field-font-size);
    line-height: 1.4;
    color: var(--picxly-field-color);
    background-color: var(--picxly-field-bg);
    border: var(--picxly-field-border);
    border-radius: var(--picxly-field-radius);
    padding: var(--picxly-field-padding-y) var(--picxly-field-padding-x);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.search-container .search-input {
    padding-left: 48px;
}

.picxly-field:focus,
.input-custom:focus,
.search-input:focus,
textarea.form-control:focus,
textarea.form-control-modern:focus,
select.form-control:focus,
input.form-control[type="text"]:focus,
input.form-control[type="email"]:focus,
input.form-control[type="tel"]:focus,
input.form-control[type="number"]:focus,
input.form-control[type="password"]:focus,
input.form-control[type="search"]:focus,
input.form-control[type="url"]:focus,
input.form-control[type="date"]:focus,
input.form-control[type="datetime-local"]:focus,
input.form-control[type="time"]:focus,
input.form-control[type="month"]:focus,
input.form-control-modern[type="text"]:focus,
input.form-control-modern[type="email"]:focus,
input.form-control-modern[type="tel"]:focus,
input.form-control-modern[type="number"]:focus,
input.form-control-modern[type="password"]:focus,
input.form-control-modern[type="search"]:focus,
input.form-control-modern[type="url"]:focus,
input.form-control-modern[type="date"]:focus {
    outline: none;
    border-color: var(--picxly-field-accent);
    background-color: var(--picxly-field-bg-focus);
    box-shadow: var(--picxly-field-focus-ring);
}

textarea.form-control,
textarea.form-control-modern {
    min-height: 96px;
    resize: vertical;
}

/* Profile / icon-prefixed fields (dashboard) */
.profile-input-wrapper input.form-control,
.profile-input-wrapper input.form-control-modern {
    padding-left: 40px;
}

.profile-input-wrapper i {
    left: 14px;
}

/* Native select: custom chevron */
select.form-control,
select.search-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8.2 1.2 3.2h9.6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

select.form-control[multiple],
select.search-input[multiple] {
    background-image: none;
    padding-right: var(--picxly-field-padding-x);
    min-height: 120px;
}

/* Do not restyle checkboxes / radios / file / range / color */
input.form-control.custom-control-input,
input[type="checkbox"].form-control,
input[type="radio"].form-control,
input[type="file"]:not(.file-input-hidden),
input[type="range"],
input[type="color"] {
    all: revert;
    width: auto;
    max-width: none;
    padding: revert;
    border: revert;
    border-radius: revert;
    background: revert;
    box-shadow: none;
}

select.search-input option:hover,
select.search-input option:focus,
select.search-input option:active,
select.search-input option:checked,
select.form-control option:hover,
select.form-control option:focus,
select.form-control option:active,
select.form-control option:checked {
    background: linear-gradient(0deg, var(--picxly-field-primary) 0%, var(--picxly-field-primary) 100%);
    background-color: var(--picxly-field-primary);
    color: #fff;
}

/* Login / register: keep fluid sizing from revamp layout */
body.login-page-revamped .input-custom {
    padding: clamp(10px, 1.6dvh, 14px) clamp(14px, 2.5vw, 20px);
    font-size: clamp(14px, 1.7dvh, 15px);
}

/* Toolbar “dropdown” trigger matches fields */
.sort-dropdown-trigger {
    padding: var(--picxly-field-padding-y) var(--picxly-field-padding-x);
    border: var(--picxly-field-border);
    border-radius: var(--picxly-field-radius);
    background: var(--picxly-field-bg);
    font-family: inherit;
    font-size: var(--picxly-field-font-size);
}

.sort-dropdown-trigger:hover {
    background: var(--picxly-field-bg-focus);
    border-color: #cbd5e1;
}

/* ---- Chosen.js (storage + customer map) ---- */
.modal-field-group .chosen-container,
.provider-select-wrapper .chosen-container {
    width: 100% !important;
    font-size: var(--picxly-field-font-size);
}

.chosen-container-single .chosen-single {
    height: auto !important;
    min-height: calc(var(--picxly-field-padding-y) * 2 + 1.35em);
    line-height: 1.4 !important;
    padding: var(--picxly-field-padding-y) 36px var(--picxly-field-padding-y) var(--picxly-field-padding-x) !important;
    border: var(--picxly-field-border) !important;
    border-radius: var(--picxly-field-radius) !important;
    background: var(--picxly-field-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
    color: var(--picxly-field-color) !important;
}

.chosen-container-single .chosen-single div b {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8.2 1.2 3.2h9.6z'/%3E%3C/svg%3E") no-repeat center center !important;
    background-size: 12px 12px !important;
}

.chosen-container-active.chosen-with-drop .chosen-single,
.chosen-container-active .chosen-single {
    border-color: var(--picxly-field-accent) !important;
    background: var(--picxly-field-bg-focus) !important;
    box-shadow: var(--picxly-field-focus-ring) !important;
}

.chosen-container .chosen-drop {
    border: var(--picxly-field-border) !important;
    border-top: none !important;
    border-radius: 0 0 var(--picxly-field-radius) var(--picxly-field-radius) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

.chosen-container-multi .chosen-choices {
    border: var(--picxly-field-border) !important;
    border-radius: var(--picxly-field-radius) !important;
    background: var(--picxly-field-bg) !important;
    background-image: none !important;
    box-shadow: none !important;
    padding: 6px 8px !important;
    min-height: calc(var(--picxly-field-padding-y) * 2 + 1.2em);
}

.chosen-container-multi.chosen-container-active .chosen-choices {
    border-color: var(--picxly-field-accent) !important;
    background: var(--picxly-field-bg-focus) !important;
    box-shadow: var(--picxly-field-focus-ring) !important;
}

.chosen-container .chosen-results li.highlighted {
    background-color: var(--picxly-field-primary) !important;
    background-image: none !important;
    color: #fff !important;
}

.chosen-container-multi .chosen-choices li.search-field input[type="text"] {
    height: auto !important;
    min-height: 28px;
    padding: 4px 6px !important;
    color: var(--picxly-field-color) !important;
}

/* Modern Multi-select Tags */
.chosen-container-multi .chosen-choices li.search-choice {
    background: #F1F5F9 !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    padding: 6px 28px 6px 12px !important;
    color: var(--picxly-field-color) !important;
    font-size: 13px !important;
    margin: 4px !important;
    box-shadow: none !important;
    position: relative !important;
}

.chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
    top: 50% !important;
    transform: translateY(-50%) !important;
    right: 8px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E") no-repeat center !important;
    background-size: 14px 14px !important;
}

.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23E53E3E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E") !important;
}

/* Elegant Modern Switch */
.switch-modern {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch-modern input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-modern {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #e2e8f0;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
    border: 1.5px solid transparent;
}

.slider-modern:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 1.5px;
    top: 1.5px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.switch-modern input:checked + .slider-modern {
    background-color: var(--picxly-field-primary, #009e6b);
}

.switch-modern input:checked + .slider-modern:before {
    transform: translateX(20px);
}

.switch-modern input:focus + .slider-modern {
    box-shadow: 0 0 0 3px rgba(0, 158, 107, 0.1);
}
