:host {
  display: block;
}

.app-color-picker {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-color-picker-swatch {
  flex: 0 0 44px;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--border-color, #e4e4e7);
  border-radius: var(--radius-md, 6px);
  background: var(--bg-primary, #fff);
  cursor: pointer;

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

.app-color-picker-text {
  flex: 1;
  height: 40px;
  padding: 0 var(--space-md, 1rem);
  border: 1px solid var(--border-color, #e4e4e7);
  border-radius: var(--radius-md, 6px);
  background: var(--bg-primary, #fff);
  color: var(--text-primary, #1f322d);
  font-family: inherit;
  font-size: var(--font-size-md, 0.9375rem);
  transition: border-color var(--transition-fast, 120ms ease),
    box-shadow var(--transition-fast, 120ms ease);

  &:focus-visible {
    outline: none;
    border-color: var(--primary-color, #2f6e5d);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color, #2f6e5d) 25%, transparent);
  }

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

.app-color-picker-text--invalid {
  border-color: var(--error-color, #c0392b);
}

@media (prefers-reduced-motion: reduce) {
  .app-color-picker-text {
    transition: none;
  }
}
