/* Global sky-blue control theme.
 * Loaded after the theme/admin styles so these overrides apply consistently
 * to the frontend, customer account, publisher dashboard and admin panel.
 */
:root {
    --sky-50: #f0f9ff;
    --sky-100: #e0f2fe;
    --sky-200: #bae6fd;
    --sky-300: #7dd3fc;
    --sky-400: #38bdf8;
    --sky-500: #0ea5e9;
    --sky-600: #0284c7;
    --sky-700: #0369a1;
    --sky-900: #0c4a6e;
}

/* Text inputs, textareas, selects and editor surfaces */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="image"]),
textarea,
select,
.form-control,
.form-select,
.custom-select,
.dataTables_filter input,
.dataTables_length select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-search__field,
.note-editor .note-editable,
.ql-editor,
.tox .tox-edit-area__iframe {
    border-color: var(--sky-400) !important;
    border-width: 1px !important;
    background-color: var(--sky-50) !important;
    color: var(--sky-900) !important;
    box-shadow: none !important;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"])::placeholder,
textarea::placeholder,
.form-control::placeholder,
.select2-search__field::placeholder {
    color: var(--sky-500) !important;
    opacity: 1 !important;
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus,
.custom-select:focus,
.select2-container--focus .select2-selection,
.select2-container--open .select2-selection,
.dataTables_filter input:focus,
.dataTables_length select:focus {
    border-color: var(--sky-600) !important;
    box-shadow: 0 0 0 0.2rem rgba(14, 165, 233, 0.22) !important;
    outline: 0 !important;
}

input:disabled,
textarea:disabled,
select:disabled,
.form-control:disabled,
.form-select:disabled,
.custom-select:disabled {
    background-color: var(--sky-100) !important;
    border-color: var(--sky-300) !important;
    color: var(--sky-700) !important;
    opacity: 1 !important;
}

select option {
    background: var(--sky-50) !important;
    color: var(--sky-900) !important;
}

select option:checked,
select option:hover {
    background: var(--sky-500) !important;
    color: #ffffff !important;
}

/* Bootstrap input groups and validation states */
.input-group-text,
.input-group-addon {
    border-color: var(--sky-400) !important;
    background: var(--sky-100) !important;
    color: var(--sky-700) !important;
}

.is-invalid,
.was-validated .form-control:invalid,
.has-error .form-control,
.has-error .form-select,
.has-error .custom-select {
    border-color: var(--sky-500) !important;
    box-shadow: 0 0 0 0.15rem rgba(14, 165, 233, 0.18) !important;
}

/* Checkboxes, radios and switches */
input[type="checkbox"],
input[type="radio"],
input[type="range"] {
    accent-color: var(--sky-500) !important;
}

input[type="checkbox"],
input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 2px solid var(--sky-400) !important;
    background-color: var(--sky-50) !important;
    display: inline-block !important;
    position: relative !important;
    vertical-align: middle !important;
    cursor: pointer !important;
}

input[type="checkbox"] {
    border-radius: 4px !important;
}

input[type="radio"] {
    border-radius: 50% !important;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    border-color: var(--sky-600) !important;
    background-color: var(--sky-500) !important;
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="radio"]:checked::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    transform: translate(-50%, -50%);
}

input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    border-color: var(--sky-300) !important;
    background-color: var(--sky-100) !important;
    cursor: not-allowed !important;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: 2px solid var(--sky-400) !important;
    outline-offset: 2px;
}

.custom-control-label::before,
.custom-checkbox .custom-control-label::before,
.custom-radio .custom-control-label::before {
    border-color: var(--sky-400) !important;
    background-color: var(--sky-50) !important;
}

.custom-control-input:checked ~ .custom-control-label::before,
.custom-control-input:indeterminate ~ .custom-control-label::before {
    border-color: var(--sky-600) !important;
    background-color: var(--sky-500) !important;
}

.custom-switch .custom-control-label::after {
    background-color: var(--sky-500) !important;
}

.form-check-input:checked {
    border-color: var(--sky-600) !important;
    background-color: var(--sky-500) !important;
}

/* Native file inputs */
input[type="file"]::file-selector-button {
    border: 1px solid var(--sky-500) !important;
    background: var(--sky-500) !important;
    color: #ffffff !important;
}

/* Primary action buttons, submit controls, currency/checkout actions */
input[type="submit"],
input[type="button"],
input[type="reset"],
button[type="submit"],
form button:not(.close):not(.btn-close):not(.navbar-toggler):not(.remove-image):not(.remove-pdf):not(.dz-remove):not(.account-icon-btn):not(.btn-icon),
.btn,
.acct-btn,
.tier-cta,
.page-link,
.pagination .page-link {
    border-color: var(--sky-600) !important;
    background-color: var(--sky-500) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

input[type="submit"]:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
button[type="submit"]:hover,
form button:not(.close):not(.btn-close):not(.navbar-toggler):not(.remove-image):not(.remove-pdf):not(.dz-remove):not(.account-icon-btn):not(.btn-icon):hover,
.btn:hover,
.btn:focus,
.acct-btn:hover,
.tier-cta:hover,
.page-link:hover,
.page-link:focus {
    border-color: var(--sky-700) !important;
    background-color: var(--sky-600) !important;
    color: #ffffff !important;
}

input[type="submit"]:focus,
input[type="button"]:focus,
input[type="reset"]:focus,
button[type="submit"]:focus,
.btn:focus-visible,
.acct-btn:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(56, 189, 248, 0.35) !important;
    outline: 0 !important;
}

/* Keep icon-only actions light while giving them a sky-blue treatment */
.account-icon-btn,
.btn-icon,
.btn-link {
    border: 1px solid var(--sky-400) !important;
    background: var(--sky-50) !important;
    color: var(--sky-600) !important;
}

.account-icon-btn:hover,
.btn-icon:hover,
.btn-link:hover {
    border-color: var(--sky-600) !important;
    background: var(--sky-100) !important;
    color: var(--sky-700) !important;
}

/* Select2 dropdowns */
.select2-container--default .select2-selection--single .select2-selection__arrow,
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--sky-500) !important;
    border-color: var(--sky-500) !important;
    color: #ffffff !important;
}

.select2-dropdown {
    border-color: var(--sky-400) !important;
    background: var(--sky-50) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background: var(--sky-500) !important;
    color: #ffffff !important;
}

.select2-container--default .select2-results__option[aria-selected="true"] {
    background: var(--sky-100) !important;
    color: var(--sky-900) !important;
}

/* Upload/drop zones and rich text editor borders */
.dropzone,
.dz-clickable,
.note-editor,
.ql-toolbar,
.ql-container,
.tox-tinymce,
.tox .tox-toolbar {
    border-color: var(--sky-400) !important;
}

.dropzone .dz-message,
.dropzone .dz-message * {
    color: var(--sky-600) !important;
}

/* Form labels and helper text */
.form-group > label,
.form-label,
.control-label {
    color: var(--sky-700) !important;
}

.form-text,
.help-block,
small.help-block {
    color: var(--sky-600) !important;
}

/* Checkout/card choice radios */
label input[type="radio"],
label input[type="checkbox"] {
    accent-color: var(--sky-500) !important;
}
