// Custom Meta Fields — form view styles

.wse-cmf-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  background: $color-surface;
  color: $color-text-secondary;
  border: 1px solid $gray-300;
  border-radius: $radius-sm;
  font-size: $font-size-sm;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background $transition-base, border-color $transition-base;

  &:hover {
    background: $gray-50;
    border-color: $gray-400;
  }

  @include focus-ring;
}

.wse-cmf-form-row {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 32px;
  padding: 24px 0;
  align-items: start;

  @media (max-width: 900px) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.wse-cmf-form-label { padding-top: 2px; }

.wse-cmf-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid $gray-300;
  border-radius: $radius-sm;
  font-size: $font-size-base;
  color: $color-text-primary;
  background: $color-surface;
  appearance: auto;
  cursor: pointer;
  transition: border-color $transition-base;

  &:focus {
    outline: none;
    border-color: $color-primary-600;
  }
}

.wse-cmf-textarea {
  width: 100%;
  min-height: 180px;
  padding: 10px 12px;
  border: 1px solid $gray-300;
  border-radius: $radius-sm;
  font-size: $font-size-sm;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  color: $color-text-primary;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color $transition-base;
  line-height: 1.6;

  &:focus {
    outline: none;
    border-color: $color-primary-600;
  }

  &::placeholder { color: $color-text-faint; }
}

.wse-cmf-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.wse-cmf-checkbox {
  width: 16px;
  height: 16px;
  accent-color: $color-primary-600;
  cursor: pointer;
  flex-shrink: 0;
}

.wse-cmf-btn-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  background: $color-surface;
  color: $color-text-secondary;
  border: 1px solid $gray-300;
  border-radius: $radius-sm;
  font-size: $font-size-sm;
  font-weight: 500;
  cursor: pointer;
  transition: background $transition-base, border-color $transition-base;

  &:hover:not(:disabled) {
    background: $gray-50;
    border-color: $gray-400;
  }

  &:disabled { opacity: 0.5; cursor: not-allowed; }
}

.wse-cmf-btn-save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  background: $color-primary-600;
  color: #fff;
  border: none;
  border-radius: $radius-sm;
  font-size: $font-size-sm;
  font-weight: 600;
  cursor: pointer;
  transition: background $transition-base;

  &:hover:not(:disabled) { background: $color-primary-700; }
  &:disabled { opacity: 0.6; cursor: not-allowed; }
}

.wse-spinner--sm    { width: 13px; height: 13px; }
.wse-spinner--white { border-color: rgb(255 255 255 / 0.3); border-top-color: #fff; }

.wse-cmf-availability-box {
  margin-top: 16px;
  padding: 16px;
  background: $gray-50;
  border: 1px solid $gray-200;
  border-radius: $radius-sm;

  &__heading {
    display: block;
    font-size: $font-size-sm;
    font-weight: 600;
    color: $color-text-primary;
    margin-bottom: 12px;
  }

  &__hint {
    margin: 12px 0 0;
    font-size: $font-size-sm;
    color: $color-primary-600;
  }
}
