/* Atomic input primitives (wedjat-cursor). Form token scoping: .wd-form only */

.wd-form {
  --wd-input-border: var(--form-input-border);
  --wd-input-border-focus: var(--form-input-focus);
  --wd-input-bg: var(--form-well-bg);
  --wd-input-bg-focus: #fff;
  --wd-input-shadow-inset: var(--form-well-inset);
  --wd-input-focus-ring: 0 0 0 4px rgba(140, 95, 40, .12);
}

.wd-form .wd-input {
  border-width: 1px;
  border-top-color: rgba(255, 255, 255, .72);
  border-bottom-color: rgba(29, 43, 42, .14);
  background: linear-gradient(180deg, #FFFDF8 0%, var(--form-well-bg) 42%, #FFFFFF 100%);
  box-shadow: var(--wd-input-shadow-inset);
}

.wd-form .wd-input:hover:not(:focus):not(:disabled) {
  border-color: rgba(140, 95, 40, .28);
  background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF8 42%, #FFFFFF 100%);
}

.wd-form .wd-input:focus {
  border-color: var(--wd-input-border-focus);
  background: #fff;
  box-shadow:
    inset 0 1px 2px rgba(29, 43, 42, .04),
    var(--wd-input-focus-ring),
    0 6px 16px -6px rgba(140, 95, 40, .20);
  transform: translateY(-1px);
}

.wd-input {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--wd-input-border);
  border-radius: 12px;
  background: var(--wd-input-bg);
  color: var(--wd-ink);
  font: inherit;
  line-height: 1.4;
  box-shadow: var(--wd-input-shadow-inset);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.wd-input:hover:not(:focus):not(:disabled) {
  border-color: rgba(43, 179, 177, .28);
}

.wd-input:focus {
  outline: 0;
  border-color: var(--wd-input-border-focus);
  background: var(--wd-input-bg-focus);
  box-shadow: var(--wd-input-focus-ring);
}

.wd-input--textarea {
  min-height: 148px;
  resize: vertical;
}

.wd-form .wd-input::placeholder {
  color: var(--form-muted);
  opacity: 1;
}

/* DLE generated HTML exception: some engine selects cannot receive wd-input--select. */
.wd-form .wd-form__select-fallback,
.wd-form select:not(.wd-input),
.wd-form .wd-form__field select {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  padding: 12px 40px 12px 14px;
  border: 1px solid var(--form-input-border);
  border-top-color: rgba(255, 255, 255, .78);
  border-bottom-color: rgba(140, 95, 40, .16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, #FFFDF8 0%, var(--form-well-bg) 42%, #FFFFFF 100%)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%234A524D' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
    no-repeat right 14px center;
  color: var(--wd-ink);
  font: inherit;
  appearance: none;
  cursor: pointer;
  box-shadow: var(--form-well-inset);
  transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

:root[data-wd-theme="dark"] .wd-form .wd-input,
:root[data-wd-theme="dark"] .wd-form .wd-form__select-fallback,
:root[data-wd-theme="dark"] .wd-form select:not(.wd-input),
:root[data-wd-theme="dark"] .wd-form .wd-form__field select {
  border-right-color: rgba(228, 191, 99, .18);
  border-left-color: rgba(228, 191, 99, .18);
  border-top-color: rgba(255, 249, 238, .1);
  border-bottom-color: rgba(0, 0, 0, .3);
  background-color: var(--form-well-bg);
  background-image: none;
  color: var(--form-text);
}

:root[data-wd-theme="dark"] .wd-form .wd-input:hover:not(:focus):not(:disabled) {
  border-color: rgba(228, 191, 99, .28);
  background: rgba(255, 249, 238, .08);
}

:root[data-wd-theme="dark"] .wd-form .wd-input:focus,
:root[data-wd-theme="dark"] .wd-form .wd-form__select-fallback:focus,
:root[data-wd-theme="dark"] .wd-form select:not(.wd-input):focus,
:root[data-wd-theme="dark"] .wd-form .wd-form__field select:focus {
  border-color: rgba(228, 191, 99, .42);
  background: rgba(13, 26, 29, .92);
  box-shadow: 0 0 0 3px rgba(228, 191, 99, .11);
}

.wd-form .wd-form__select-fallback:focus,
.wd-form select:not(.wd-input):focus,
.wd-form .wd-form__field select:focus {
  outline: 0;
  border-color: var(--wd-input-border-focus);
  background-color: #fff;
  box-shadow:
    inset 0 1px 2px rgba(29, 43, 42, .04),
    var(--wd-input-focus-ring),
    0 6px 16px -6px rgba(140, 95, 40, .20);
  transform: translateY(-1px);
}

.wd-form .wd-input[type="checkbox"],
.wd-form .wd-input[type="radio"] {
  accent-color: var(--form-primary-dark);
}

.wd-input[type="checkbox"],
.wd-input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wd-input[type="file"] {
  min-height: auto;
  padding: 10px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wd-input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(43, 179, 177, .24);
  border-radius: 10px;
  background: rgba(43, 179, 177, .08);
  color: var(--form-heading);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.wd-input[type="file"]::file-selector-button:hover {
  border-color: rgba(43, 179, 177, .36);
  background: rgba(43, 179, 177, .14);
}

.wd-input[type="hidden"] {
  display: none;
}

.wd-input--search {
  min-height: 36px;
  padding-left: 16px;
  border-color: rgba(15, 111, 115, .22);
  background: rgba(255, 255, 255, .62);
  box-shadow: inset 0 1px rgba(255, 255, 255, .72), 0 4px 12px rgba(7, 18, 41, .04);
  font-size: .84rem;
}

.wd-header__search .wd-input--search {
  min-height: 36px;
}

.wd-nav__search .wd-input--search {
  width: 100%;
  min-height: 38px;
  padding: 8px 42px 8px 13px;
  border-radius: 999px;
  transition: min-height .32s ease, padding .32s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.wd-nav__search .wd-input--search:focus {
  border-color: rgba(15, 111, 115, .48);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(43, 179, 177, .08);
}

.wd-nav--stuck .wd-nav__search .wd-input--search {
  border-color: rgba(229, 198, 129, .22);
  background: rgba(255, 255, 255, .09);
  color: #f4eee2;
}

.wd-nav--stuck .wd-nav__search .wd-input--search::placeholder {
  color: rgba(244, 238, 226, .64);
}

.wd-nav--stuck .wd-nav__tools .wd-nav__search .wd-input--search {
  min-height: 32px;
  padding: 6px 36px 6px 12px;
}

/* DLE search widget exception: legacy search inputs can be emitted without wd-input. */
.wd-search input:not([type="submit"]):not([type="button"]),
.wd-search input.wd-input {
  min-width: 0;
  height: 48px;
  padding: 0 15px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.wd-search input:not([type="submit"]):not([type="button"]):focus,
.wd-search input.wd-input:focus {
  box-shadow: none;
}

.wd-form.wd-search-page,
.search-page.wd-form {
  --wd-input-border: var(--form-input-border);
  --wd-input-border-focus: var(--form-input-focus);
  --wd-input-bg: var(--form-surface-muted);
  --wd-input-bg-focus: var(--form-surface);
  --wd-input-shadow-inset: var(--form-well-inset);
  --wd-input-focus-ring: 0 0 0 4px rgba(43, 179, 177, .14);
}

/* DLE searchtable exception: generated advanced search field. */
.wd-search-page__controls input[type="text"] {
  display: block;
  width: min(100%, 520px) !important;
  min-height: 50px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--wd-input-border);
  border-radius: 12px;
  background: var(--wd-input-bg);
  color: var(--wd-ink);
  font-size: 1rem;
  box-shadow: var(--wd-input-shadow-inset);
}

.wd-search-page__controls input[type="text"]:focus {
  outline: 0;
  border-color: var(--wd-input-border-focus);
  background: var(--wd-input-bg-focus);
  box-shadow: var(--wd-input-focus-ring);
}

.wd-form .bb-editor textarea,
.wd-form .fr-box .fr-element,
.wd-form .tox-edit-area textarea {
  box-shadow: none;
}

.wd-form .bb-editor textarea:not(.wd-input),
.wd-form .fr-box .fr-element:not(.wd-input) {
  width: 100%;
}
