/**
 * Ceyora unified form controls — text fields, native selects, Select2
 * Loaded on client portal, public/auth pages, and admin panel.
 */
:root {
    --cf-primary: #1062fe;
    --cf-primary-bg: rgba(16, 98, 254, 0.08);
    --cf-border: #e2e8f0;
    --cf-border-hover: #cbd5e1;
    --cf-radius: 4px;
    --cf-height: 42px;
    --cf-text: #0f172a;
    --cf-muted: #64748b;
    --cf-bg: #ffffff;
    --cf-bg-muted: #f8fafc;
    --cf-shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
    --cf-focus-ring: 0 0 0 3px rgba(16, 98, 254, 0.12);
    --cf-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    --cf-chevron-focus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231062fe' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* ---------- Base text inputs & textareas ---------- */
body.client-portal-body .page-content .form-control,
body.client-portal-body .page-content .form--control,
body.client-portal-body .page-content .form-select,
body.client-portal-body .page-content select.form-control,
body.client-portal-body .page-content select.form--control,
body.client-portal-body .page-content select,
body.client-portal-body .page-content textarea.form-control,
body.client-portal-body .page-content textarea,
body.client-portal-body .page-content input[type="text"]:not(.verification-code-digit),
body.client-portal-body .page-content input[type="email"],
body.client-portal-body .page-content input[type="password"],
body.client-portal-body .page-content input[type="number"],
body.client-portal-body .page-content input[type="search"],
body.client-portal-body .page-content input[type="tel"],
body.client-portal-body .page-content input[type="url"],
body.client-portal-body .page-content input[type="date"],
body.client-portal-body .page-content input[type="datetime-local"],
body.client-portal-body .page-content input[type="time"],
body.client-portal-body .page-content .input-group .form-control,
body.client-portal-body .modal .form-control,
body.client-portal-body .modal .form--control,
body.client-portal-body .modal .form-select,
body.client-portal-body .modal select.form-control,
body.client-portal-body .modal select,
body.client-portal-body .modal textarea.form-control,
body.client-portal-body .modal textarea,
body.ceyora-public .form-control,
body.ceyora-public .form--control,
body.ceyora-public .form-select,
body.ceyora-public select.form-control,
body.ceyora-public select,
body.ceyora-public textarea.form-control,
body.ceyora-public textarea,
body.ceyora-public input[type="text"]:not(.verification-code-digit),
body.ceyora-public input[type="email"],
body.ceyora-public input[type="password"],
body.ceyora-public input[type="number"],
body.ceyora-public input[type="search"],
body.ceyora-public input[type="tel"],
body.ceyora-public input[type="url"],
body.ceyora-public input[type="date"],
body.ceyora-public input[type="datetime-local"],
body.ceyora-public input[type="time"],
body.ceyora-public .input-group .form-control,
body.ceyora-admin .form-control,
body.ceyora-admin .form--control,
body.ceyora-admin .form-select,
body.ceyora-admin select.form-control,
body.ceyora-admin select,
body.ceyora-admin textarea.form-control,
body.ceyora-admin textarea,
body.ceyora-admin input[type="text"]:not(.verification-code-digit),
body.ceyora-admin input[type="email"],
body.ceyora-admin input[type="password"],
body.ceyora-admin input[type="number"],
body.ceyora-admin input[type="search"],
body.ceyora-admin input[type="tel"],
body.ceyora-admin input[type="url"],
body.ceyora-admin input[type="date"],
body.ceyora-admin input[type="datetime-local"],
body.ceyora-admin input[type="time"],
body.ceyora-admin .input-group .form-control {
    border: 1px solid var(--cf-border) !important;
    border-radius: var(--cf-radius) !important;
    min-height: var(--cf-height);
    height: var(--cf-height);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cf-text);
    background-color: var(--cf-bg);
    box-shadow: none !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.client-portal-body .page-content textarea.form-control,
body.client-portal-body .page-content textarea,
body.client-portal-body .modal textarea.form-control,
body.client-portal-body .modal textarea,
body.ceyora-public textarea.form-control,
body.ceyora-public textarea,
body.ceyora-admin textarea.form-control,
body.ceyora-admin textarea {
    min-height: 110px;
    height: auto;
}

body.client-portal-body .page-content .input-group-text,
body.client-portal-body .modal .input-group-text,
body.ceyora-public .input-group-text,
body.ceyora-admin .input-group-text {
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    min-height: var(--cf-height);
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cf-muted);
    background-color: var(--cf-bg-muted);
}

body.client-portal-body .page-content .form-control::placeholder,
body.client-portal-body .page-content .form--control::placeholder,
body.client-portal-body .modal .form-control::placeholder,
body.ceyora-public .form-control::placeholder,
body.ceyora-public .form--control::placeholder,
body.ceyora-admin .form-control::placeholder,
body.ceyora-admin .form--control::placeholder {
    color: var(--cf-muted);
    opacity: 1;
}

body.client-portal-body .page-content .form-control:focus,
body.client-portal-body .page-content .form--control:focus,
body.client-portal-body .page-content .form-select:focus,
body.client-portal-body .page-content select:focus,
body.client-portal-body .page-content textarea:focus,
body.client-portal-body .page-content input[type="date"]:focus,
body.client-portal-body .modal .form-control:focus,
body.client-portal-body .modal .form--control:focus,
body.client-portal-body .modal .form-select:focus,
body.client-portal-body .modal select:focus,
body.client-portal-body .modal textarea:focus,
body.ceyora-public .form-control:focus,
body.ceyora-public .form--control:focus,
body.ceyora-public .form-select:focus,
body.ceyora-public select:focus,
body.ceyora-public textarea:focus,
body.ceyora-admin .form-control:focus,
body.ceyora-admin .form--control:focus,
body.ceyora-admin .form-select:focus,
body.ceyora-admin select:focus,
body.ceyora-admin textarea:focus {
    border-color: var(--cf-primary) !important;
    box-shadow: var(--cf-focus-ring) !important;
    outline: none;
}

body.client-portal-body .page-content .form-control:disabled,
body.client-portal-body .page-content .form-control[readonly],
body.client-portal-body .modal .form-control:disabled,
body.client-portal-body .modal .form-control[readonly],
body.ceyora-public .form-control:disabled,
body.ceyora-public .form-control[readonly],
body.ceyora-admin .form-control:disabled,
body.ceyora-admin .form-control[readonly] {
    background-color: var(--cf-bg-muted);
    pointer-events: none;
    opacity: 0.85;
}

/* ---------- Native select / dropdown ---------- */
body.client-portal-body .page-content .form-select,
body.client-portal-body .page-content select.form-control,
body.client-portal-body .page-content select.form--control,
body.client-portal-body .page-content select,
body.client-portal-body .modal .form-select,
body.client-portal-body .modal select.form-control,
body.client-portal-body .modal select,
body.ceyora-public .form-select,
body.ceyora-public select.form-control,
body.ceyora-public select,
body.ceyora-admin .form-select,
body.ceyora-admin select.form-control,
body.ceyora-admin select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px !important;
    cursor: pointer;
    background-color: var(--cf-bg);
    background-image: var(--cf-chevron);
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    line-height: 1.25;
}

body.client-portal-body .page-content .form-select:hover,
body.client-portal-body .page-content select:hover,
body.client-portal-body .modal .form-select:hover,
body.client-portal-body .modal select:hover,
body.ceyora-public .form-select:hover,
body.ceyora-public select:hover,
body.ceyora-admin .form-select:hover,
body.ceyora-admin select:hover {
    border-color: var(--cf-border-hover) !important;
}

body.client-portal-body .page-content .form-select:focus,
body.client-portal-body .page-content select:focus,
body.client-portal-body .modal .form-select:focus,
body.client-portal-body .modal select:focus,
body.ceyora-public .form-select:focus,
body.ceyora-public select:focus,
body.ceyora-admin .form-select:focus,
body.ceyora-admin select:focus {
    background-image: var(--cf-chevron-focus);
}

body.client-portal-body .page-content .form-select option,
body.client-portal-body .page-content select option,
body.client-portal-body .modal select option,
body.ceyora-public select option,
body.ceyora-admin select option {
    color: var(--cf-text);
    background: var(--cf-bg);
    font-weight: 500;
}

body.client-portal-body .page-content input[type="date"],
body.client-portal-body .modal input[type="date"],
body.ceyora-public input[type="date"],
body.ceyora-admin input[type="date"] {
    padding-right: 10px;
}

/* ---------- Select2 ---------- */
body.client-portal-body .page-content .select2-container,
body.client-portal-body .modal .select2-container,
body.ceyora-public .select2-container,
body.ceyora-admin .select2-container {
    width: 100% !important;
}

body.client-portal-body .page-content .select2-container--default .select2-selection--single,
body.client-portal-body .modal .select2-container--default .select2-selection--single,
body.ceyora-public .select2-container--default .select2-selection--single,
body.ceyora-admin .select2-container--default .select2-selection--single {
    height: var(--cf-height);
    border: 1px solid var(--cf-border) !important;
    border-radius: var(--cf-radius) !important;
    background-color: var(--cf-bg);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.client-portal-body .page-content .select2-container--default .select2-selection--single .select2-selection__rendered,
body.client-portal-body .modal .select2-container--default .select2-selection--single .select2-selection__rendered,
body.ceyora-public .select2-container--default .select2-selection--single .select2-selection__rendered,
body.ceyora-admin .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px;
    padding-left: 12px;
    padding-right: 40px;
    color: var(--cf-text);
    font-size: 13px;
    font-weight: 500;
}

body.client-portal-body .page-content .select2-container--default .select2-selection--single .select2-selection__arrow,
body.client-portal-body .modal .select2-container--default .select2-selection--single .select2-selection__arrow,
body.ceyora-public .select2-container--default .select2-selection--single .select2-selection__arrow,
body.ceyora-admin .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    width: 36px;
    right: 2px;
}

body.client-portal-body .page-content .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.client-portal-body .modal .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.ceyora-public .select2-container--default .select2-selection--single .select2-selection__arrow b,
body.ceyora-admin .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--cf-muted) transparent transparent transparent;
    border-width: 5px 5px 0 5px;
    margin-left: -5px;
    margin-top: -2px;
}

body.client-portal-body .page-content .select2-container--default.select2-container--open .select2-selection--single,
body.client-portal-body .page-content .select2-container--default.select2-container--focus .select2-selection--single,
body.client-portal-body .modal .select2-container--default.select2-container--open .select2-selection--single,
body.client-portal-body .modal .select2-container--default.select2-container--focus .select2-selection--single,
body.ceyora-public .select2-container--default.select2-container--open .select2-selection--single,
body.ceyora-public .select2-container--default.select2-container--focus .select2-selection--single,
body.ceyora-admin .select2-container--default.select2-container--open .select2-selection--single,
body.ceyora-admin .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--cf-primary) !important;
    box-shadow: var(--cf-focus-ring);
}

body.client-portal-body .select2-dropdown,
body.ceyora-public .select2-dropdown,
body.ceyora-admin .select2-dropdown {
    border: 1px solid var(--cf-border) !important;
    border-radius: var(--cf-radius);
    box-shadow: var(--cf-shadow-md);
    overflow: hidden;
}

body.client-portal-body .select2-container--default .select2-results__option,
body.ceyora-public .select2-container--default .select2-results__option,
body.ceyora-admin .select2-container--default .select2-results__option {
    font-size: 13px;
    padding: 8px 12px;
    color: var(--cf-text);
}

body.client-portal-body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
body.ceyora-public .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
body.ceyora-admin .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--cf-primary-bg) !important;
    color: var(--cf-primary) !important;
}

body.client-portal-body .select2-container--default .select2-results__option--selected,
body.ceyora-public .select2-container--default .select2-results__option--selected,
body.ceyora-admin .select2-container--default .select2-results__option--selected {
    background: var(--cf-bg-muted) !important;
    color: var(--cf-text) !important;
}

body.client-portal-body .select2-container--default .select2-selection--multiple,
body.ceyora-public .select2-container--default .select2-selection--multiple,
body.ceyora-admin .select2-container--default .select2-selection--multiple {
    min-height: var(--cf-height);
    border: 1px solid var(--cf-border) !important;
    border-radius: var(--cf-radius) !important;
    padding: 4px 8px;
}

body.client-portal-body .select2-container--default.select2-container--focus .select2-selection--multiple,
body.ceyora-public .select2-container--default.select2-container--focus .select2-selection--multiple,
body.ceyora-admin .select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--cf-primary) !important;
    box-shadow: var(--cf-focus-ring);
}

body.client-portal-body .select2-container--default .select2-selection--multiple .select2-selection__choice,
body.ceyora-public .select2-container--default .select2-selection--multiple .select2-selection__choice,
body.ceyora-admin .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--cf-primary-bg);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    font-size: 12px;
    color: var(--cf-text);
}

/* Override legacy height utility classes */
body.client-portal-body .page-content .h-45,
body.client-portal-body .modal .h-45,
body.ceyora-public .h-45,
body.ceyora-admin .h-45,
body.ceyora-admin input.form-control,
body.ceyora-admin select.form-control {
    height: var(--cf-height) !important;
    min-height: var(--cf-height);
}

/* Select2 dropdown search — override legacy main.css white text on white background */
body.client-portal-body .select2-search--dropdown,
body.ceyora-public .select2-search--dropdown,
body.ceyora-admin .select2-search--dropdown {
    padding: 8px !important;
    border-bottom: 1px solid var(--cf-border);
}

body.client-portal-body .select2-container--default .select2-search--dropdown .select2-search__field,
body.ceyora-public .select2-container--default .select2-search--dropdown .select2-search__field,
body.ceyora-admin .select2-container--default .select2-search--dropdown .select2-search__field {
    color: var(--cf-text) !important;
    background: #fff !important;
    border: 1px solid var(--cf-border) !important;
    border-radius: var(--cf-radius);
    padding: 8px 12px !important;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    box-shadow: none;
}

body.client-portal-body .select2-container--default .select2-search--dropdown .select2-search__field::placeholder,
body.ceyora-public .select2-container--default .select2-search--dropdown .select2-search__field::placeholder,
body.ceyora-admin .select2-container--default .select2-search--dropdown .select2-search__field::placeholder {
    color: var(--cf-muted);
    opacity: 1;
}

body.client-portal-body .select2-container--default .select2-search--dropdown .select2-search__field:focus,
body.ceyora-public .select2-container--default .select2-search--dropdown .select2-search__field:focus,
body.ceyora-admin .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: var(--cf-primary) !important;
    box-shadow: var(--cf-focus-ring);
}
