/* Shared input, textarea, select, custom select styles */
.cp-input,
.cp-textarea,
.cp-select {
  width: 100%;
  font-family: inherit;
  font-size: var(--cp-size-secondary);
  font-weight: 600;
  color: var(--cp-color-text-primary);
  background: var(--cp-color-surface);
  border: 1px solid var(--cp-color-border-subtle);
  border-radius: 12px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cp-input,
.cp-select {
  min-height: 42px;
  padding: 10px 12px;
}

.cp-textarea {
  padding: 10px 12px;
  min-height: 90px;
  resize: vertical;
}

.cp-select,
.board-select__input {
  color-scheme: light;
}

.cp-select option,
.board-select__input option {
  color: var(--cp-color-text-primary);
  background: var(--cp-color-surface);
}

.cp-input::placeholder,
.cp-textarea::placeholder {
  color: color-mix(in srgb, var(--cp-color-text-muted) 82%, white 18%);
}

.cp-input:focus,
.cp-input:focus-visible,
.cp-textarea:focus,
.cp-textarea:focus-visible,
.cp-select:focus,
.cp-select:focus-visible {
  outline: none;
  border-color: var(--cp-color-accent);
  box-shadow: inset 0 0 0 2px rgba(59, 110, 143, 0.22);
}

.cp-input:disabled,
.cp-textarea:disabled,
.cp-select:disabled {
  color: var(--cp-color-text-muted);
  -webkit-text-fill-color: var(--cp-color-text-muted);
  background: var(--cp-color-surface-subtle);
}

.cp-custom-select {
  position: relative;
  width: 100%;
  z-index: 1;
  overflow: visible;
}

.cp-custom-select.is-disabled {
  opacity: 0.7;
}

.cp-custom-select__trigger {
  list-style: none;
  border: 1px solid var(--cp-color-border-subtle);
  border-radius: 12px;
  background: var(--cp-color-surface);
  color: var(--cp-color-text-primary);
  min-height: 42px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}

.cp-custom-select__trigger:focus,
.cp-custom-select__trigger:focus-visible {
  outline: none;
}

.cp-custom-select__trigger::-webkit-details-marker {
  display: none;
}

.cp-custom-select__value.is-placeholder {
  color: var(--cp-color-text-muted);
}

.cp-custom-select__value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.cp-custom-select__option-content {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cp-custom-select__icon {
  font-size: 0.95em;
  color: var(--cp-color-text-muted);
}

.cp-custom-select__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--cp-color-text-muted);
  position: relative;
  top: 0px;
  transform-origin: center center;
  transition: transform 0.2s ease;
}

.cp-custom-select__chevron svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cp-custom-select[open] .cp-custom-select__chevron {
  transform: rotate(180deg);
}

.cp-custom-select[open] .cp-custom-select__trigger {
  border-color: var(--cp-color-accent);
  box-shadow: inset 0 0 0 2px rgba(59, 110, 143, 0.22);
}

.cp-custom-select.is-disabled .cp-custom-select__trigger {
  cursor: not-allowed;
}

.cp-custom-select.is-disabled .cp-custom-select__trigger:focus,
.cp-custom-select.is-disabled .cp-custom-select__trigger:focus-visible {
  border-color: var(--cp-color-border-subtle);
  box-shadow: none;
}

.cp-custom-select[open] {
  position: relative;
  z-index: 9990;
}

.cp-custom-select__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 9991;
  border: 1px solid var(--cp-color-border-subtle);
  border-radius: 12px;
  background: var(--cp-color-surface);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  padding: 6px;
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.cp-custom-select--up .cp-custom-select__menu {
  top: auto;
  bottom: calc(100% + 6px);
}

.cp-custom-select__option {
  text-align: left;
  width: 100%;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cp-color-text-primary);
  padding: 8px 10px;
  font-size: var(--cp-size-secondary);
  line-height: 1.4;
  cursor: pointer;
}

.cp-custom-select__option.has-divider {
  border-top: 1px solid var(--cp-color-border-subtle);
  margin-top: 4px;
  padding-top: 12px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.cp-custom-select__option.is-hovered {
  background: var(--cp-color-surface-subtle);
}

.cp-custom-select__option.is-selected {
  background: var(--cp-color-accent-subtle);
  color: var(--cp-color-accent);
  font-weight: 600;
}

.cp-custom-select__option.is-selected .cp-custom-select__icon {
  color: currentColor;
}

.cp-custom-select__option:disabled {
  color: var(--cp-color-text-muted);
  cursor: not-allowed;
}
